Sunday, November 9, 2008

Search on single field using SearchView

If you want to search a view for specific field value then you can use SearchView as shown below.

Ex. If you want documents having "Yes" as value for "IsActive" Field then you can use SearchView as given below.

http://server/dbname.nsf/viewname?SearchView&QUERY=FIELD%20IsActive=Yes

Wednesday, October 22, 2008

"splice" - JS method to add/remove array elements

Definition and Usage

The splice() method is used to remove and add new elements to an array.

Syntax

arrayObject.splice(index,howmany,element1,.....,elementX)

 

Parameter

Description

index

Required. Specify where to add/remove elements. Must be a number

howmany

Required Specify how many elements should be removed. Must be a number, but can be "0"

element1

Optional. Specify a new element to add to the array

elementX

Optional. Several elements can be added

 


Example

In this example we will create an array and add an element to it:

<script type="text/javascript">
var arr = new Array(5);
arr[0] = "Jani";
arr[1] = "Hege";
arr[2] = "Stale";
arr[3] = "Kai Jim";
arr[4] = "Borge";
document.write(arr + "<br />");
arr.splice(2,0,"Lene");
document.write(arr + "<br />");
</script>

The output of the code above will be:

Jani,Hege,Stale,Kai Jim,Borge
Jani,Hege,Lene,Stale,Kai Jim,Borge

 


Example

In this example we will remove the element at index 2 ("Stale"), and add a new element ("Tove") there instead:

<script type="text/javascript">
var arr = new Array(5);
arr[0] = "Jani";
arr[1] = "Hege";
arr[2] = "Stale";
arr[3] = "Kai Jim";
arr[4] = "Borge";
document.write(arr + "<br />");
arr.splice(2,1,"Tove");
document.write(arr);
</script>

The output of the code above will be:

Jani,Hege,Stale,Kai Jim,Borge
Jani,Hege,Tove,Kai Jim,Borge

 


Example

In this example we will remove three elements starting at index 2 ("Stale"), and add a new element ("Tove") there instead:

<script type="text/javascript">
var arr = new Array(5);
arr[0] = "Jani";
arr[1] = "Hege";
arr[2] = "Stale";
arr[3] = "Kai Jim";
arr[4] = "Borge";
document.write(arr + "<br />");
arr.splice(2,3,"Tove");
document.write(arr);
</script>

The output of the code above will be:

Jani,Hege,Stale,Kai Jim,Borge
Jani,Hege,Tove


Ref Link : http://www.w3schools.com/jsref/jsref_splice.asp

Monday, October 13, 2008

JavaScript function equivalent to Arraygetindex

 
This js function will find the index of an array element with the given value in an array.
for Example you are having an array like
var mnuArray = new Array("Groups","Services","Applications");
And want to know the index/position of and element in an array, then
Ex. you can call mnuArray.findIndex("Services");
This will return "1″.
 
This will be helpful if you are having a large size array/the elements are unknown which you have populated from an dB
 
Array.prototype.findIndex = function(value){
var ctr = "";
for (var i=0; i < this.length; i++) {
// use === to check for Matches. ie., identical (===), ;
if (this[i] == value) {
return i;
}
}
return ctr;
};
And advanced version of this function is,
If you want to do the same in the case of multidimensional arrays
then use the following
 
Array.prototype.findIndexByCol = function(value,cIdx){
var ctr = "";
for (var i=0; i < this.length; i++) {
// use === to check for Matches. ie., identical (===), ;
if (this[i][cIdx] == value) {
//alert(this[i][cIdx]+"===="+value);
return i;
}
}
return ctr;
};
 
 

Wednesday, July 9, 2008

Lotus Domino Best Practices Wiki

A Lotus Domino Best Practices Wiki has been launched on developerWorks. Its purpose is to create a collaborative environment where customers, business partners, architects, support, and development can share best practices for Domino server administration and deployment. So go ahead and share your best practices!

Monday, March 31, 2008

Notes and Domino Buzz Kit



In case if you have not seen this, have a look at the below link for the large collection of links to videos, demos and community websites around the Notes/Domino marketplace.
Have a look at all the TABS {Welcome, Market Buzz, Resources...}
its really a good resource for education on Notes and Domino.

My IBM Lotus Notes and Domino Buzz Kit <http://www.netvibes.com/tcoustenoble> {http://www2.netvibes.com/tcoustenoble#Developing_extensions <http://www2.netvibes.com/tcoustenoble>}


Also have a look at the

1.) LotusPlanet <http://planetlotus.org/> {<http://planetlotus.org/>}

2.) developerWorks e-kits <http://www-128.ibm.com/developerworks/offers/ekits/?S_TACT=105AGY01&S_CMP=BLOG> : its give you a collection of tutorials, articles, webcasts, podcasts, and demos about a particular product, task, or role.
{
http://www-128.ibm.com/developerworks/offers/ekits/?S_TACT=105AGY01&S_CMP=BLOG#lotus <http://www-128.ibm.com/developerworks/offers/ekits/?S_TACT=105AGY01&S_CMP=BLOG> }

Thanks,
Abhijit.


Friday, March 28, 2008

In Place Merge Sort

According to Wikipedia InPlaceMergeSort is a pretty fast sorting algorithm (O(n log n) on average, O(n log n) worst case and O(1) memory usage.) Sub InPlaceMergeSort(vArray As Variant, nLow0 As Integer, nHigh0 As Integer)
Dim nLow As Integer
Dim nHigh As Integer
Dim nMid As Integer
Dim nEndLow As Integer
Dim nStartHigh As Integer
Dim vTemp As Variant
Dim nCount As Integer nLow = nLow0
nHigh = nHigh0
If nLow >= nHigh Then
Exit Sub
End If nMid = (nLow + nHigh) \ 2 Call InPlaceMergeSort(vArray, nLow, nMid)
Call InPlaceMergeSort(vArray, nMid + 1, nHigh) nEndLow = nMid
nStartHigh = nMid + 1 While nLow <= nEndLow And nStartHigh <= nHigh
If vArray(nLow) < vArray(nStartHigh) Then
nLow = nLow + 1
Else
vTemp = vArray(nStartHigh)
For nCount = nStartHigh -1 To nLow Step -1
vArray(nCount + 1) = vArray(nCount)
Next
vArray(nLow) = vTemp
nLow = nLow + 1
nEndLow = nEndLow + 1
nStartHigh = nStartHigh + 1
End If
Wend
End Sub Sub sort(vArray As Variant)
Call InPlaceMergeSort(vArray, Lbound(vArray), Ubound(vArray))
End Sub

Thursday, March 27, 2008

Profiling agents and Web services

Today I came to know about new very interesting and helpful Designer-7 feature. i.e. "Profiling agents and Web services".

By using profile document developers can know total execution time taken by the agent in milliseconds. Here is how to profile an agent -
1. To enable profiling in an agent or Web service, select the Security tab of the properties box and check "Profile this agent" or "Profile this web service."
2. Run your agent

To view profile document results of latest run-
1. Select the agent and choose Agent - View Profile Results, or select the Web service and choose Design - View Profile Results.

Screen shot for profile document results is shown below:



For more information on the same please have a look at Designer Help Document.

Wednesday, March 26, 2008

Thing Two of Three about @Dbfunctions


Yesterday I talked about reasons to use a separate, hidden view for @DbColumn and @DbLookup. But if you choose to risk the wrath of harkpabst, and use a single view (without re-sorts!) for both users and lookups, can you at least mitigate the adverse effect on maintainability?

There is one thing you can do. For @DbLookup, for the argument that specifies what column to get the results from, you can code either a column number, or a name. For instance, if column 5 displays the field DateDue, you could write either:

@DbLookup(""; ""; "lkByKey"; Key; 5)
or
@DbLookup(""; ""; "lkByKey"; Key; "DateDue")
and the result is the same.
(For @DbColumn, you must use a column number. Too bad.)

You might have been taught that it's more efficient to use the column number because the value is read directly from the view index, whereas using a fieldname requires accessing the document, which is slower. This is only approximately true. The Designer help actually says, "Lookups based on view columns are more efficient than those based on fields not included in the view." Because DueDate is included in the view -- there's a column that displays that exact value -- the two formulas above are equally efficient. There may be some tiny difference between them, but very small compared to the extra time it takes to "crack open" the document note to read an item value that's not in a column, and I'm not actually even sure which is faster.

So, all right; that's nice. If the above two formulas are equally fast, there are two good reasons to use the second one.

  • It's more readable.
  • It's more maintainable because it won't break if you edit the view design and rearrange the columns. Even if you delete the column, the lookup will still work. It just won't be as fast.
But wait! There's more! By successive approximations, we come ever closer to the truth. In fact, when you specify a name argument to @DbLookup, it's not a fieldname. It's really the column name. Only if there are no columns with the specified name, does the lookup code open the document note to look for items with that name.

"What!" (you might be saying to yourself) "Columns have names? Does he mean the column title?"

Column programmatic nameNo. I'm referring to the column "programmatic name" which appears on the Advanced tab of the column properties. If the column just refers to a field, it's automatically assigned a programmatic name which is the name of the field. That's why "DueDate" works in the above formula. You're not referring to the field named DueDate in that formula; you're referring to the column by that name. If you write a formula in the column instead of selecting a field, the column is assigned a unique programmatic name of the form $n where n is a number, but you can change it if you like.

Now here's a key point: you can use the column name to specify the data column for your lookup. So if you know a column is called "$4", you can write:

@DbLookup(""; ""; "lkByKey"; Key; "$4")
instead of using the column number. Once again it's just as efficient, but less likely to break when someone edits the view design.

Of course, $4 is not a very descriptive name to appear in your formula. If you want to use the column for lookups, I suggest entering a better name in the column properties.

One other fun thing you can do with column names (if you share my ideas of fun), is use them in the formulas of other columns. This is occasionally useful in avoiding a repetition of some complex calculation.

Tuesday, March 25, 2008

Notes Domino 8 LotusScript courses

The Learning Continuum Company (TLCC) has released three new distance learning LotusScript courses for Notes Domino 8. There is no need to travel with TLCC's self-paced courses that will take a new LotusScript programmer from a beginner to an expert in two weeks. There are many demonstrations and activities to give you the hands-on experience you need to become an expert. An expert TLCC instructor can provide assistance via the course discussion database. Taking all three LotusScript courses will prepare the student to take the certification exam 803: Using LotusScript in IBM Lotus Notes Domino 8 Applications.

The three new courses are Beginner LotusScript for Notes Domino 8, Intermediate LotusScript for Notes Domino 8, and Advanced LotusScript for Notes Domino 8. All three courses may be purchased individually. Another option is TLCC's Notes Domino 8 LotusScript Package, which includes all three courses. TLCC is having an introduction sale on the Notes Domino 8 LotusScript Package. Developers can save $800 compared to purchasing the courses separately if the package is purchased by April 15th.

Friday, February 22, 2008

Quick way to populate drop down for calendar Years

range := (-1) : 0 : 1 : 2 : 3;
thisYear := @Year(@Today);
thisYear + range
Although, this works in web, I find that Notes Client needs this list as "Text" !, so we the last line changed to:
@Text(thisYear + range)

Result:
2007
2008
2009
2010
2011

Friday, February 1, 2008

The History of Notes and Domino

The History of Notes and Domino

Notes and Domino began in the work of Ray Ozzie, Tim Halvorsen, and Len Kawell, first on PLATO Notes at the University of Illinois and later on DECNotes. Lotus founder Mitch Kapor saw the potential in Ozzie's collaboration project and the rest is history.

As you might expect of such complex and successful software, IBM Lotus Notes and Domino share a long and rich history. In some respects, this history mirrors the evolution of the computing industry itself -- the development and widespread adoption of PCs, networks, graphical user interfaces, communication and collaboration software, and the Web. Lotus Notes and Domino have been there nearly every step of the way, influencing (and being influenced by) all these critical developments.

This article briefly retraces the history of Lotus Notes and Domino, starting with the earliest conceptual and development stages and continuing through major feature releases. Along the way, it examines:
Where the idea of Notes originated
Notes pre-release development

Release 1.0
Release 2.0
Release 3.0
Release 4.0 and 4.5
Release 5.0
Release 6 and 6.5
Release 7
Release 8


The early days: The birth of an idea

You may find this a little surprising, but the original concept that eventually led to the Notes client and Domino server actually pre-dates the commercial development of the personal computer by nearly a decade. Lotus Notes and Domino find their roots in some of the first computer programs written at the Computer-based Education Research Laboratory (CERL) at the University of Illinois. In 1973, CERL released a product called PLATO Notes. At that time, the sole function of PLATO Notes was to tag a bug report with the user's ID and the date and to make the file secure so that other users couldn't delete it. The system staff could then respond to the problem report at the bottom of the screen. This kind of secure communication between users was the basis of PLATO Notes. In 1976, PLATO Group Notes was released. Group Notes took the original concept of PLATO Notes and expanded on it by allowing users to:


  • Create private notes files organized by subject
  • Create access lists
  • Read all notes and responses written since a certain date
  • Create anonymous notes
  • Create director message flags
  • Mark comments in a document
  • Link notes files with other PLATO systems
  • Use multiplayer games

PLATO Group Notes became popular and remained so into the 1980s. However, after the introduction of the IBM PC and MS-DOS by Microsoft in 1982, the mainframe-based architecture of PLATO became less cost-effective. Group Notes began to metamorphose into many other "notes type" software products.
Share this...

Ray Ozzie, Tim Halvorsen, and Len Kawell worked on the PLATO system at CERL in the late 1970s. All were impressed with its real-time communication. Halvorsen and Kawell later took what they learned at CERL and created a PLATO Notes-like product at Digital Equipment Corporation.

At the same time, Ray Ozzie worked independently on a proposal for developing a PC-based Notes product. At first, he was unable to obtain funding for his idea. However, Mitch Kapor, founder of Lotus Development Corporation, saw potential in Ozzie'

Thursday, January 17, 2008

An attempt to define Lotus Notes from various dimensions

Below is the article where author has made an attempt to Define notes. Really good one. Plz take some time and read.I have pasted the article as it is authors language.

A confession to start with: I was totally ignorant about the Lotus Notes technology before joining IBM.

But Then Again…

I knew at least something about other technologies like Java, C, RDBMS, SAP, etc. So, why is it that people are ignorant about this powerful collaborative tool called Lotus Notes?

The answer I feel lies in the fact that not very many people actually know what is Lotus Notes. Is it an e-mail system or DBMS or a programming language!!

In the subsequent lines I have made an attempt to express my understanding of Lotus Notes, which is entirely based on my personal rendezvous' with Notes over the last year and a half.

So, what exactly is Lotus Notes?The very popular face of Lotus Notes is that of an e-mail system.

But Then Again…

It's different from Microsoft Exchange as it's (by its native character) a database system with an in built mailing system.

But Then Again…

Its not relational database like Oracle or DB2.But Then Again…It's also got support for several programming languages, and a web server component that enables accessing data from a web browser. It's more like an Exchange, SQL Server, Access and Visual Basic all wrapped together. But it's packaged in a way that we don't see all those separate components individually. That's what makes it such a powerful workflow application.

After the above animated description of Lotus Notes let us make things a bit simpler.

Lotus Notes as an e-mail system:

As I said earlier e-mail is the most recognizable feature of Lotus Notes. Having all traits other popular e-mail products in the market, including calendaring and scheduling, it uses the standards-based mail protocols such as POP3 and SMTP. Because Notes has both a client and a server piece, users can use it to read and respond to e-mail, and administrators can use it as an entire e-mail environment.

The Lotus Notes Client:

The Lotus Notes client is a desktop application displays databases on a user's local workstation allowing the users to organize them as per their need. The database files can be stored either on the user's workstation itself or on a server. The Lotus Notes desktop (often referred as Workspace) consists of tabbed pages with icons for local databases as well as remote databases.

Lotus Notes from a developer's perspective:

I repeat, Lotus Notes is primarily a database system. A generic statement can safely be made "Everything in Notes is a database". Even the e-mail system is realized with individual users having their own e-mail databases.

Besides data, a notes database can also contain modules of programming code that will perform background, scheduled, or on-demand tasks for a user. The data is displayed through the display components like Forms, which are used to create and modify documents while views, navigators and outlines are used to access desired data. And now the most important aspect of a notes database-its security. A Lotus Notes database is highly secured and the security is realized with minimal effort. The security in a Notes database is incorporated using ACL (Access Control List). The ACL of a Notes database defines what level of access a user has. Typical access levels are Depositor, Reader, Author, Editor, Designer and Manager. Besides the ACL (which defines the database level security) there are provisions for document level security too through the Readers and the Authors fields. In a nut shell Lotus Notes can be considered a complete package for a rapid development of applications. With security features second to none, this product of IBM which had its first release in 1989 is leading software for office automation i.e. realizing the concept of paperless office. The article explains Lotus Notes in its different manifestations….

But Then Again….

I assume I know only a third of Lotus Notes.