To avoid that - set this option you see on screen below (I believe at some point IBM will set as default)
Wednesday, December 29, 2010
Useful option when you are doing Java in LDD
To avoid that - set this option you see on screen below (I believe at some point IBM will set as default)
Thursday, December 23, 2010
CSS staff you have to know
1. div>h1 { color: red;}
- means all h1 that are child to div will get that CSS, but not sub child.
examples:
<h1>this is red</h1>
</div>
<div>
<p>
<h1>this is not red</h1>
</p>
</div>
2. p+h1 {color:red}
- means make red h1 in case if it is going just after p on the same level
examples:
<div>
<p></p>
<h1>this is red text</h1>
</div>
<div>
<p></p>
<h2></h2>
<h1>this is not red text</h1>
</div>
3. p~h1 {color:red} (similar to +)
- means make red h1 in case if it is on the same level with p
</div>
<div>
<p></p>
<h2></h2>
<h1>this is also red text</h1>
</div>
4. p:first-child {color:red}
- means make red p in case if it is first child
examples:
<body>
<p>This is red text</p>
<p>This is not read</p>
</body>
Saturday, December 18, 2010
I've installed FP1 (for 8.5.2) without any problems.
Monday, December 13, 2010
I've just passed exam #190-951. IBM Lotus Notes Domino 8.5 Application Development Update
Monday, December 06, 2010
Expand and Collapse views in xPages
Collapse all
var viewPanel = getComponent(compositeData.viewPanelName);
var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();
var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();
container.collapseAll();
Expand all
var viewPanel = getComponent(compositeData.viewPanelName);
var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();
var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();
container.expandAll();
That's much better then save values in sessionScope/RequestScope and use property expandLevel in viewPanel.
Tuesday, November 16, 2010
JS staff: Use Object instead of Switch.
Let me show couple examples
1. Example with switch
function FoodType(food) {
var getfoodtype;
switch(food) {
case 'apple': getfoodtype = 'fruit'; break;
case 'cucumbers': getfoodtype = 'vegetable'; break;
case 'watermelon': getfoodtype = 'strawberry'; break;
default: getfoodtype = 'not recognized';
}
return getfoodtype;
}
var getfoodtype, case, and break, we can avoid them.
2. Example with Object
FoodType {
apple: fruit,
cucumbers: vegetable,
watermelon: strawberry,
GetFoodType: function(type) {
return(this[type] || 'not recognized');
}
}
Ofc there could be cases where Object approach does not work and we have to use switch, but it is alternative, so keep in mind this.
Friday, November 12, 2010
Dynamical counter in Lotus Notes client
Let me show my example, I've a form, there I have couple fields I need to show length of it (because there is some validation of length for this field).
There are actually 2 fields: 1 for input and another one is just below the Title of field (computed type).
What we need to do - use some simple JavaScript lines..
step 1.
go to JS Header even in form/subform and put there couple lines of JS (select Run: Client and JavaScript)
var f = document.forms[0];
var stopDynamicalCounter = 0;
function updateCharCounter(delay) {
if(stopDynamicalCounter == 0) return;
f.AlternateTitle_length.value = f.AlternateTitle.value.length;
setTimeout( 'updateCharCounter( ' + delay + ' )', delay);
}
step 2.
select input-field, and go to onFocus event, select Run: Client and JavaScript and put there 2 lines
stopDynamicalCounter = 1;
updateCharCounter(100)
step 3.
select input-field, and go to onBlur event, select Run: Client and JavaScript and put there 1 line
stopDynamicalCounter = 0;
That's all.
Computewithform does not work properly at 8.5.2
Computewithform just stopped to work (but when you use debugger and look into document before computewithform it works fine).
Here is my solution to avoid this problem
Set doc=view.GetDocumentByKey(key, True)
Dim bug as String
bug=doc.UniversalID '(or any item) '// that is actually the main line, funny?
Call doc.ComputeWithForm(False, False)
Tuesday, November 09, 2010
Very nice SOAP client (java)
I've implement also LS2J approach
here is my example. There are some enhancements need to do, but anywhere this also works fine.
Java library
import java.io.*;
import java.net.*;
public class ECWebservice {
String cResponse;
String wsurl;
String msg;
String contentType;
public ECWebservice(String init_url) throws IOException {
wsurl = init_url;
msg = "";
contentType = "text/xml; charset=utf-8";
cResponse = "";
}
public String GetResponce() {
return cResponse;
}
public void SetContentType(String init_contenttype) {
contentType = init_contenttype;
}
public boolean Send(String init_msg) {
boolean result = true;
try {
msg = init_msg;
// Create the connection where we're going to send the file.
URL url = new URL(wsurl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
String SOAPAction = msg;
byte[] b = SOAPAction.getBytes();
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty( "Content-Length", String.valueOf(SOAPAction.length()));
httpConn.setRequestProperty("Content-Type", contentType);
httpConn.setRequestProperty("SOAPAction", SOAPAction);
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
// Everything's set up; send the XML that was read in to b.
OutputStream out = httpConn.getOutputStream();
out.write(b);
out.close();
// Read the response and write it to standard out.
InputStreamReader isr = new InputStreamReader(httpConn.getInputStream(), "utf-8");
BufferedReader in = new BufferedReader(isr);
String inputLine;
while ((inputLine = in.readLine()) != null) {
cResponse += inputLine;
}
in.close();
} catch(Exception e) {
e.printStackTrace();
cResponse = "Main: Exception occured - check Java Debug Console";
result = false;
}
return result;
}
}
LS2J library
Option Public
Option Declare
Use "webservice.core"
UseLSX "*javacon"
Class ECWebservice
responce As string
connection As string
contentType As string
Sub New(connection_url As string)
connection = connection_url
contentType = "text/xml; charset=utf-8"
End Sub
Public Property Get GetResponce As string
GetResponce = responce
End Property
public Property Set SetConnection
connection = SetConnection
End Property
Public Property Set SetContentType
contentType = SetContentType
End Property
Function SendXMLRequest(xmldata) As Boolean
On Error Goto errorproc
'** everything we'll need to access our Java classes
Dim jSession As New JavaSession
Dim jClass As JavaClass
Dim jObject As JavaObject
'** get the IGWebservice class and instantiate an instance of it
Set jClass = jSession.GetClass("ECWebservice")
'** version of CreateObject and init with path to WSDL)
Set jObject = jClass.CreateObject("(Ljava/lang/String;)V", connection)
jObject.SetContentType(contentType)
'** send message and get result: true/false, if true then we got result
If jObject.send(xmldata) Then
me.responce = jObject.GetResponce()
End If
SendXMLRequest = True
endofsub:
Exit Function
errorproc:
MsgBox "Error #" & Err & " on line " & Erl & " in function " & Lsi_info(2) & " : " & Error, 48, "Runtime error"
Resume endofsub
End Function
End Class
Thursday, November 04, 2010
Lotus Notes got SVN: Can't believe we get that :)
Thursday, October 28, 2010
xPage: Could not load 'imb.xsp.widget.layout.TypeAhead'
Monday, October 11, 2010
xPage: date picker does not work in IE8
Workaround
http://www-10.lotus.com/ldd/nd85forum.nsf/0/579744cf7198e21785257731006c9cea?OpenDocument
Thursday, September 16, 2010
Change encoding attribute after XLST
I've done some transformation my DXL using XSLT. The funny thing was that after transformation using
// Transform
var str = docxml.transformNode(xsl);
I always got 'encoding' as UTF-16, that's not correct, so after some time I found nice solution
here is code I used: http://dotnet.itags.org/dotnet-tech/66097/
var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.load("test.xml");
// Print initial encoding
var pi = doc.firstChild;
var eattr = pi.attributes.getNamedItem("encoding");
var encoding = eattr.value;
// Convert to string and reload (this loses the encoding)
var xml = doc.xml;
doc.loadXML(xml);
// Reset the encoding to "ISO-8859-1"
pi = doc.firstChild;
var eattr = pi.attributes.getNamedItem("encoding");
if (eattr == null) {
eattr = doc.createAttribute("encoding");
pi.attributes.setNamedItem(eattr);
}
eattr.value = "ISO-8859-1";
// And save document with new encoding.
doc.save("test2.xml");
It works fine for me (and not, output option in XSL did not help)
Wednesday, September 15, 2010
Date.prototype.addDays
// add days
Date.prototype.addDays = function(days) {
var secsDay = 86400000; // there are 86400000 secs in 1 day
var time = this.getTime(); // number of milliseconds since midnight of January 1, 1970.
var newdate = new Date(time + (days * secsDay));
this.setDate(newdate.getDate());
}
If anybody has better solution, you are welcome!
Tuesday, September 14, 2010
'wget' as way to download files
Friday, September 10, 2010
Need to zip file with password in Lotus Notes?
Thursday, August 26, 2010
Don't forget that if you have URL http://host/db/yourform?OpenForm
Tuesday, August 24, 2010
I've just installed 8.5.2, so have to read what's new in Designer
Tuesday, July 13, 2010
the new free CRM based on xPage is on the way
DesktopX.ndk and possible problem with it
Wednesday, June 23, 2010
New version of Skytus is available!
- loading/unloading skype's add-in manager (it does supporting of skype status in real time) much more correctly. We got couple reports (special thanks to Tony Austin) about crashes of LN from time to time after installing Skytus. Hope there are no any issues in that area anymore.
- we've added new feature - synchronization. now users will be able to sync already created contacts in PAB with contacts in Skype, hope many of you will find it useful.
- very important thing we did also is Skytus SDK, that's is really awesome thing! from my point of view. We will add first version of sdk to download page later (hope next week) when finish msi installation for SDK. I will post about possibilities of SDK later in next post.
- speaking about SDK I have also admit that we migrated skytus product to it, so now it is done in more right way.
Now I'm thinking about next steps:
- should we concentrate on new functionality of skytus and continue to improve it? we could probably do recording of voice or improve mail database with skytus' things?
- should we freeze new functionality of skytus for short period and do fixes only and see how it is going on? and in the same time start to do new integration with another AI/tools/product (yep, we already have some ideas what to integration with LN).
What I would really want is to hear any ideas/comments/suggestions from you, that's would be really helpful for us.test link
Wednesday, June 09, 2010
Get temporary folder on PC/MAC
Declare Function w32_OSGetSystemTempDirectory Lib "nnotes" Alias "OSGetSystemTempDirectory" ( Byval S As String) As Integer
Declare Function mac_OSGetSystemTempDirectory Lib "NotesLib" Alias "OSGetSystemTempDirectory" ( Byval S As String) As Integer
Declare Function linux_OSGetSystemTempDirectory Lib "libnotes.so" Alias "OSGetSystemTempDirectory" ( Byval S As String) As Integer
Select Case session.Platform
Case "Linux"
s% = linux_OSGetSystemTempDirectory(d)
Case "Macintosh"
s% = mac_OSGetSystemTempDirectory(d)
Case "Windows/32"
s% = w32_OSGetSystemTempDirectory(d)
End Select
Friday, June 04, 2010
JS/CSS/HTML compressors do you use?
CSS =>http://developer.yahoo.com/yui/compressor/
HTML => I've never used such tools at all, so would be interested in your suggestions :)
Friday, May 28, 2010
I already installed FP3 !
Monday, May 17, 2010
google and keyword '[site:googleblog.blogspot.com]'
Sunday, May 16, 2010
How to check Domino website for XSS?
http://www.codestore.net/store.nsf/unid/BLOG-20080926
http://www-01.ibm.com/support/docview.wss?rs=477&uid=swg21247201
http://www.stevecastledine.com/sc.nsf/dx/domino-blog-xss-warning
http://it.toolbox.com/blogs/enterprise-solutions/xss-vulnerability-in-lotus-notesdomino-url-handler-3439
Sunday, April 25, 2010
New version of Skytus 0.2.0 is available for download !
Tuesday, April 20, 2010
open view into another database using outline
session.SendConsoleCommand returns error: 'You are not authorized to use the remote console on this server'
I wanted to run console command from server-A on server-B.
If you look in the Google you will find IBM article about 2 possible solutions for this error:
http://www-01.ibm.com/support/docview.wss?uid=swg21178432
Tuesday, April 06, 2010
Old staff: Switch tabs/rows programatically
If you use tabs/rows on your forms and want to switch tabs/rows programmatic don't think that it difficult, it is very easy, couple clicks and couple lines of code.
So let's start, 'go go go' as we say :) !
1) Go to the property of table, open 'Table Programming' tab (the last one) and give the name of the whole table (Name/ID tag), also please give the name to all rows you want to switch using your code (Row Tags, Name)
2) Now let's go to the property Table Rows and select "Switch rows programatically" (otherwise it will not work, even if you cast magic), also enable 'show the tabs so user can pick row'.
3) Add field to the form with name = Name/ID tag and add prefix $. (f.x. if you called your table MainTable, field should be $MainTable, the purpose of this field is to contain name of row we need to show).
4) Now do your code, here is example of button/event
FIELD $MainTable := "Content";
@Command([ViewRefreshFields])
That's all.
Monday, March 29, 2010
RefreshDesign of NotesDatabase using NotesAPI
I'm really interesting in approach without NotesAPI, but did not find any good. If somebody know better approach, please share it :)
Function RefreshDesign(sourceDb As NotesDatabase, refreshServer As string)
Dim destPath As String
Dim rc As Integer
Dim hDb As Integer
If sourceDb.Isopen Then
'sourceDb could be local or server
If sourceDb.server = "" Then
destPath = sourceDb.filePath
Else
destPath = sourceDb.server & "!!" & sourceDb.filePath
End If
' Open the db in the API and get a handle to the open db
rc = W32_NSFDbOpen(destPath, hDb)
' Return zero on success, non-zero on failure
If rc = 0 Then
rc = W32_DesignRefresh(refreshServer, hDb, 0, 0, 0)
Call W32_NSFDbClose(hDb)
End If
End If
End Function
Saturday, March 27, 2010
Tuesday, March 09, 2010
We made new version of Skytus 0.1.15. it is available for download now !
- fixed issues we found in last build (0.1.14).
- added some more stability to LN when it does not have Skype installed on it.
- we made many tests with this add-on so it should be much more stable.
So if you still did not try our tools, do it now: Skytus !
We will be happy for any comments/suggestions!
Tuesday, February 23, 2010
Cannot create automation object when we use RunOnserver
Agent1 create OLE object (WinHttp.WinHttpRequest or MSXML2.ServerXMLHTTP or it could be another OLE object without Quit/Exit method). As these objects do not have Quit/Exit method Domino continued to keep these objects in memory(?). So next time when I run agent I gave an error:
"Cannot create automation object"
I found workaround for this. It is strange, but it works.
I created new agent and called it on server instead of agent1 (f.x. agentNew.RunOnServer) This new agent called agent1 locally (f.x. Call agent1.Run). There is also article on IBM about solution for error Cannot create automation object
Funny, right?
Saturday, February 20, 2010
Action failed, document has been deleted
So Actually profile was in database but LS was unable to get it.
as solution I just re-save it and it started to work.
Wednesday, February 10, 2010
Gmail Buzz
Don't you like it? it looks very funny
Sunday, January 31, 2010
Approach to fill word/excel documents without Office installed
So after some research I decided to use the most simple way from my point of view.
Idea is next -> put predefined text (f.x. ##fieldName1##, ##fieldName2##) on word/excel documents and then save them as XML. I did not use bookmark because it is impossible (at least looks like impossible) to process them in XML.
So what do we have at this point? Document saved as XML with predefined text on it.
Then when we need to fill and show document to user we just take our XML template, take all content from it and do many replaces (we replace predefined text on our data from notes document), then don't forget to remove all predefined text that were not filled by some reasons, and then important point print it for web user like this:
Print {Content-Type:application/msword}
Print {Cache-Control: public, must-revalidate}
Print {Expires: Sat, 26 Jul 1997 05:00:00 GMT}
Print xml_output
Monday, January 25, 2010
8.5.1. FP1 found problem during installation. Error: version mismatch. Expected to find version "20090929.1223", found version(s): "20091002.1006".
Error: version mismatch. Expected to find version "20090929.1223", found version(s): "20091002.1006".
I did not find the reason why I had older version then 20090929.1223 but I found one post on IBM with similar issue.
So, let me show how I avoided it, I unpacked installation to my PC, went to ..\deploy\hotfix folder and changed one variable in file fix.ini -> ForVersion=20091002.1006 (you can add some text to about lotus dialog if you change some another variables).
When you finish it, run setup.exe from root directory, it should installed then correctly.
p.s. Do it on your won risk, I'm not sure that it will not do some affects of LN :-)
Sunday, January 24, 2010
How to check all content-type values?
so here is a way how we can look at it
HKEY_CLASSES_ROOT \ Mime \ Database \ Content Type \
f.x. for excel it will be like this
Print {Content-Type:application/vnd.ms-excel}
Print {Cache-Control: public, must-revalidate}
Print {Expires: Sat, 26 Jul 1997 05:00:00 GMT}
Print xml_output
Monday, January 11, 2010
Open XFDF file in Browser using Abobe Reader
Print {Content-Type:application/vnd.adobe.xfdf}
Print {Cache-Control: public, must-revalidate}
Print {Expires: Sat, 26 Jul 1997 05:00:00 GMT}
Print xml_output
Sunday, January 10, 2010
How to open XFDF file from IE in Adobe Reader?
on my PC I have set associated application for xfdf file - Adobe Reader.
1) IE opens my xfdf file in XML format, and that's all. that's the biggest pain,
2) FF opens it in good way, but anywhere it ask which application to use when open xfdf file.
3) Chrome, just download files without anything.
Any ideas? :) I will update my post later if I solve the problem
Saturday, January 09, 2010
iText announced new version of their product 5
I tried to update my code with that library, but I had to do some changes before, because new library has some changes in naming.
Anywhere it is really good that iText did not stop and moving forward, that's cool. Good job
Monday, January 04, 2010
Way to show FLV into you web pages
Here is an example of code how to do this

Let me do some comments for new people.
1) First of all I have to say that I used 1.5 version of swfobject instead of last one swfobject2.2. I'm planning to update it to 2.2 very soon. So please use 2.2 instead of 1.5, but anywhere approach is very similar.
- as you see DIV with ID FLV is used to be replaced with code that swfobject will generate to show SWF/FLV video.
- preview.swf is a player use want to use to show FLV video.
- your.flv is a FLV file you want to show.
