Wednesday, December 29, 2010

Useful option when you are doing Java in LDD

If you are doing java in LDD you always need to save design elements after you update your source code. It is so painful (at least for me) because each time I need to check result I have to switch from source window to design window and do save there.

To avoid that - set this option you see on screen below (I believe at some point IBM will set as default)

autosave-java-design-element

Thursday, December 23, 2010

CSS staff you have to know

I'm sure most of you have worked with CSS. I'm sure many of you know that, but some do not, so here are some nice practices that can help you.
1. div>h1 { color: red;}
- means all h1 that are child to div will get that CSS, but not sub child.
examples:
<div>
<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
examples:
<div>
<p></p>
<h1>this is red text</h1>
</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>

Monday, December 06, 2010

Expand and Collapse views in xPages

Found very nice solution

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.

Well, many of us use switch to solve own tasks, but there is another way I would like to show. We can use Object approach to solve our problem and it looks more intelligent from my point of view.

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

Have you ever tried to show length of field (f.x. just below the field) ?

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

So when user input new char in Title field, Character count should increase to 1. Know how to do that? I believe many of you know, but anywhere I would like to share this approach.

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

Many people + me as well faced up with strange issue after migrated to 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)

Here is link to nice java soap client
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, October 28, 2010

xPage: Could not load 'imb.xsp.widget.layout.TypeAhead'

Does somenody saw such issue? Got it when added typeAhead to customer control. It works fine when I open new document, but when I go to edit mode always get such message, any ideas?

Monday, October 11, 2010

xPage: date picker does not work in IE8

Just found that standard date picker does not work properly in IE8 (it always refresh page when we click on date/time picker. That's not funny :/ question - why do all another browsers work fine?

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

I did not find that method how can I add days to my date, so here is solution:

// 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

Need to download files from our Domino server by this path http://host/myfile.log, using MS DOS command?
You can try to use wget as one of possible way to do that.
here is an exmplae of DOS command:
wget.exe http://host/myfile.log
I've run this DOS command in my JS file (yes ActiveX is required for that), but anywhere it is quite interesting approach.

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.