Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
A flexible approach to keeping a history of recent edits (continued)

Having stored the necessary information about the initial save, we now come to the four list fields that track all subsequent saves: fEHNums, fEHEditors, fEHDates, and fEHDescriptions. They all use essentially the same code, so if you understand one, you should understand them all. They're all multi-valued (or "list") fields that display each value on a separate line. This is very important because the "nth" revision number always corresponds to the nth editor, the nth edit date, and the nth description. In order to preserve and display this relationship, all four fields must have the same number of values and line up exactly. The table columns must also be wide enough to display every list value on a single line, since wrapping would throw off the alignment.

This can be a little tricky in a tool that has flexible settings governing the addition and replacement of "rows." So, to help keep the design simple and synchronized, the fdEHIntervalControl field first figures out whether the new row of values should replace the last row or be appended after it. That is, if this is the first or second save or the current editor is different than the last editor, the field returns "Append". Otherwise, it compares the time since the last edit against fEHInterval. If the interval has not been exceeded, it returns "Replace." Otherwise, it returns "Append".

Note: I use the term "append" backward throughout this article because the Editor History is displayed in reverse order. When "appending" a new value to each list field, I'm really inserting it at the beginning of the list.

n := @Elements (fEHDates);
@If(
n = 0;
@Return("Append");
""
);

DEFAULT fEHInterval := 0;
origtime := @If(
n = 1;
fEHCreated;
@Subset( @Subset( fEHDates; 2); -1)
);

newtime := @Adjust( origtime ; 0; 0; 0; 0; 0; fEHInterval);
val := @If(
@Now > newtime;
"Append";
@Name([CN]; @UserName) != @Subset(fEHEditors; 1) ;
"Append";
"Replace"
);
@If( @IsError (val); "Append"; val)

After fdEHIntervalControl makes the Append/Replace decision, the list fields themselves have two remaining tasks. They must actually append or replace with the new value, and they must limit the sliding window to the specified number of rows.

The first part of each list field's formula is specific to the specific field. It gets a handle on the existing list and its size and then determines what the new value should be. For example, the formula in fEHNums starts out by incrementing the sequence number from the previous save:

list := fEHNums;
n := @Elements(list);
newval := @If(
n<1;
1;
@Subset(list; 1) + 1
);
ValIfError := 1;


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  Next »
Other articles you might like
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login