Friday, September 10, 2010

Need to zip file with password in Lotus Notes?

I've task where we need to compress and protect attachments and some log files. I did not look in Lotus Script area at all (as I'm sure it would be not possible or to difficult to do such thing). So I started to look for free RAR/ZIP Java libraries that will have what I need (compress and password).
I was surprised a bit, RAR does not have such API at all, but ZIP has already built in Domino library that allow us to zip files but... not to set password (at least I did not find).

So after couple minutes in google I've found only one free Java library that could zip files with password: http://code.google.com/p/winzipaes/
There were no problems during implementation, library is well described.
Java, Java and Java :)

Thursday, August 26, 2010

Don't forget that if you have URL http://host/db/yourform?OpenForm

Then you need to have at least Author access with ability to create documents in database or... just check option Available to Public Access users in form settings.


Otherwise you can get message into your browser
"You are not authorized to perform this operation."

Tuesday, July 13, 2010

the new free CRM based on xPage is on the way

We (means me and my fellow :)) started to do free CMS based on xPage in our free time. The main aim for us is to get more experience in xPage's area. When we finish we will upload it to openntf, I hope first version will be available soon.
here is how it looks now: Kubus CMS
It would be nice to hear any responses.


DesktopX.ndk and possible problem with it

Each Lotus Notes has this desktopX.ndk (X - is number of version of LN) file into Data folder. On of his function is to keep workspace tabs and icons for user. So if you want to have empty workspace, close Lotus Notes and move desktopX.ndk to temporary place and run LN again, yep, workspace will be empty.
It has one ugly behaviour from my point of view I discovered couple years ago and faced up yesterday again. This file keeps some information about database-icons (f.x. server, replica and filepath). Each user in our company when run Lotus Notes see Start-Up page, all required links are there. Links are managed, so each link is simply Title, and Server+Replica, that's all, and that's enough to open application.
Due to some reasons we changed location for couple applications (actually we moved 2 applications to another folder). We MOVED applications so Server and ReplicaID did not change.
After that all users were not able to open applications we moved (I mean they were not able to open from startup page). Good thing - I known what to do just of previous experience... It looks when user tries to open application using Server/Replica Lotus Notes looks into dekstop.ndk first and if it find will use Server/Filepath to open application, but as I told Filepath has been changed for some applications, so the dialog about wrong filepath name will appear.
So what we did - removed desktopX.ndk for each user (good new we have ~15 users only, so it was not a huge task).

Wednesday, June 23, 2010

New version of Skytus is available!

Hi ! I'm glad to introduce new version of Skytus :). Hope many of you already read/heard about it and some of you already tried to use it.

What did we do in current version (0.3.0.)? are you interested? Hope you are :). Here is short list of main things we did:

- 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

How often do you need to extract files to temporary folder, process them and import back? I do this from time to time, hope you are as well :).
Let's say you have image attached to document and you would like to change it to 32x32 size (obviously you need to change width and height of image in case if it is to big) and attach back to document instead.
I would like to ask about place you usually use to export files. Yes, it is quite easy to extract files to "C:\", easy? right? but not correct, users for sure will not have right for creating files there. Of course I'm pretty sure 95% of you use Environ("Temp") and Environ("Tmp") to determine temporary folder so that's fine, that's I believe only one possible way.
but now question about MAC users, how we can determine their temporary folder? I always use hardcode (yea, shame on me :) ) with path \var\tmp and this approach works fine (at least till this day), but I still can't forget this hardcoded \var\tmp so if anybody know the right way please share it !
Update
here is great link that I was looking for (Thanks to Sasa). Actually main part we need from lss here

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?

JS => http://closure-compiler.appspot.com/home
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

Monday, May 17, 2010

google and keyword '[site:googleblog.blogspot.com]'

I did not know that :) we can easily run 'goggle's search' only one specific site, that's excellent :)
f.x. run this as search criteria 'site:googleblog.blogspot.com hello or monday'

as I say: better late than never

Sunday, April 25, 2010

New version of Skytus 0.2.0 is available for download !

The major changes are installation and unistallation. Now this is MSI installation (before it was NSF, and I have to say I do not liked it). Now it will be more native for user to install and uninstall Skytus. There are also some changes/updates for functionality.

So go on and try it :)

Tuesday, April 20, 2010

open view into another database using outline

If you want to open view form another database into current one using outline -> use URL approach.
here is short instruction:
- open property of your outline an select one Entry
- select type URL and make result like this:
"notes://" + @Name([CN]; @ServerName) + "/" + DBReplicaID+ "/" + "myview?OpenView"
- do not forget to choose Frame (target)

This is actually very easy but some people asked me long time ago how to do that, so I would like to share this and help to anybody.

session.SendConsoleCommand returns error: 'You are not authorized to use the remote console on this server'

Got subj. issue tonight.

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

It is known thing but not VERY VERY known :-] , so it can be useful to anybody.

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

Here is an example how we can do refresh design 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 !

What do we have in new version?
- 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

I had situation where my agent1 (I run it on server like agent1.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

Problem was because I used profile document (and somebody re-save/re-create it).
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

Today I found that my gmail account got new feature - Buzz.
Don't you like it? it looks very funny

Sunday, January 31, 2010

Approach to fill word/excel documents without Office installed

I've had task where we need to fill our word/excel templates with data from notes documents on Server and get URL to users (our application for web uses only). All users have Office installed but Domino server does not have (and will not have installed it).

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".

I've tried to update Lotus Notes 8.5.1 on different PC and got problem

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?

I have some tasks where I have to open xml document in related application, so I had to know the content type values. I did not know that it could be checked in regedit :-)

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

got Lotus Notes 8.5.1 FP1 installed ! who will be last ? :)

There are many fixes in that fix pack, so will see how it works :-)

Monday, January 11, 2010

Open XFDF file in Browser using Abobe Reader

I was facing with one simple problem. I had XFDF file on our web suite. Users open that XFDF file as URL (http://database/view/doc/$File/fileName) but it did not open in Adobe Reader, but in Browser as XML. I looked around and found solution. Add these line before XFDF output and it will start to work.

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?

I have really interesting problem. I have posted XFDF file on my site and planning that user will click on it and get PDF file opened. But the strange this is that each browser has different behavior:

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 use iText library in some of my LN applications, so I check their site sometimes for updates. Today I found that they announced new version - iText 5 (last one was 2.1.7).
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

If you want to show SWF/FLV files onto you pages I would propose to use swfobject.js library. It's free and open. Here is a link to their site.

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.