Search DominoPower's 11,443 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.
Tools for working with Notes Doclinks (continued)

Lines 13 to 16 check that we have a late enough Notes client to be able to use NotesRichTextNavigator. That was new in Notes 6, build 190.

In line 19 we get a collection of the selected documents, or just the current document if one is open. Don't use this agent on an open-for-editing document. It updates the back end document and not the NotesUIDocument. Beware that if you use it on an open-for-read document, you won't see the changes until you close and re-open. It's really designed for use from a view.

The loop between 24 and 56 processes the selected documents. In line 26, we get hold of the Body field which is where the text and doclinks are. If you are using a differently named Rich Text field in your documents, then you'll need to alter this. In the next line, we create a NotesRichTextNavigator to let us to step through the doclinks in the Rich Text, and at line 29 we find the first one and start a loop around all of them. Line 46 is where we step on to the next doclink element in the Rich Text.

There is a difference between finding an element of the relevant type, and getting the actual element content. The Find... methods move the current position around the Rich Text element, and the Get... methods get hold of the element itself, without moving the pointer. So you have to use both.

At line 31, we get the doclink with GetElement. First thing to do is see if it points to another database by comparing the replicaID field in the doclink with the replicaID of the current database. If it's in a different database, we remember that (line 44) until we've completed checking all the links in the document. If the doclink is in the same database, we then check in line 33 to see if its target is this document -- in other words it points to itself. If it is, then it is likely to be an Anchor link. Anchor links are destroyed, turned into self-pointing doclinks, if you play with the comment content, so we need to leave them untouched.

If the link points to another document, then we try to get hold of the document it points to in line 35 with NotesDocument.GetDocumentByUnid using the Doclink's point-to Unid value.

We have three possible returns from that statement:

  • A valid document is returned. When that happens, the doclink comment field is updated with information taken from fields in the returned - pointed-to - document, in line 40.

  • An invalid document is returned. This will happen if the doclink points to a delete stub. In other words, the pointed-at document has been deleted but not purged since the doclink was created. You need to use NotesDocument.IsValid rather that NotesDocument.IsDeleted to check this. IsValid tells you if the document was deleted when you first get it, and IsDeleted is used for a check while you have it open.

  • o document is returned at all. This happens if the original document has been deleted and the doclink has been purged from the database.

The code in lines 36 to 38 deals with the latter two possibilities.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Lotus Technologies > Notes (84 articles)
   A walk down Memory Lane with Lotus Notes
   An application for scanning physical mail and distributing it virtually
   Managing Notes deployments with Teamstudio Build Manager
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Home > Strategies > Document Management (14 articles)
   An application for scanning physical mail and distributing it virtually
   Evaluating your Domino Document Manager (Domino.Doc) transition options
   What to look for in a Domino-based document management solution
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
Syncing Notes with Android phones
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
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: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


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