Home       About Genii       Products       Downloads       News & Events       Support       Weblog   
May, 2008
SMTWTFS
    01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
April, 2008
March, 2008
February, 2008
January, 2008
December, 2007
November, 2007

Show all 60 months


Search the weblog

Ben Langhinrichs
E-mail address - Ben Langhinrichs

Photograph of Ben Langhinrichs



©2003-2008 Genii Software Ltd. All rights reserved. The rights to all logos, images, etc. are owned by their respective owners.

The views expressed in this weblog are mine alone, but since I am President and Owner, they necessarily also reflect the views of Genii Software, Ltd.
Genii Weblog
Genii Weblog

Getting started with doclinks

Sun 24 Aug 2003, 10:32 PM

This "Getting started..." series of articles shows simple code snippets to demonstrate how to use common features of the Midas Rich Text LSX.  These are not meant to be full fledged samples, for which you could go to the Midas Samples page, but rather small bits of code to show how to get started.  These articles will also appear in the Reference section of the Midas Help db in somewhat altered form.



The Midas Rich Text LSX lets you find, create, manipulate and extract doclinks.  The most common tasks are accessing doclinks and retrieving their values, changing one or more component of all doclinks in a rich text field, and adding a new doclink.  Below are some quick code snippets to show these tasks.  Additional information can be found in the Midas Help db along with information about the individual properties and methods which relate to doclinks.

Accessing all doclinks and getting their values
Set rtchunk = rtitem.DefineChunk("Doclink 1")
If rtchunk.Exists Then
   Do
      Messagebox _
      "Replica ID: " & rtchunk.LinkReplicaID & Chr(10) & _
      "View UNID: " & rtchunk.LinkViewUniversalID & Chr(10) & _
      "Note UNID: " & rtchunk.LinkNoteUniversalID & Chr(10) & _
      "Popup text: " & rtchunk.LinkPopupText & Chr(10) & _
      "Hint server: " & rtchunk.LinkHintServer & Chr(10) & _
      "Anchor text: " & rtchunk.LinkAnchorText, _
      0, "Doclink Information for " & rtchunk.Definition
   Loop Until Not rtchunk.GetNextTarget
End If

Accessing all hyperlinks (link hotspots on text) and getting their values
Set rtchunk = rtitem.DefineChunk("Hyperlink 1")
If rtchunk.Exists Then
   Do
      Messagebox _
      "Link hotspot: " & rtchunk.Text & Chr(10) & _
      "Replica ID: " & rtchunk.LinkReplicaID & Chr(10) & _
      "View UNID: " & rtchunk.LinkViewUniversalID & Chr(10) & _
      "Note UNID: " & rtchunk.LinkNoteUniversalID & Chr(10) & _
      "Popup text: " & rtchunk.LinkPopupText & Chr(10) & _
      "Hint server: " & rtchunk.LinkHintServer & Chr(10) & _
      "Anchor text: " & rtchunk.LinkAnchorText, _
      0, "Hyperlink Information for " & rtchunk.Definition
   Loop Until Not rtchunk.GetNextTarget
End If

Changing one component of all doclinks (e.g., changing view unid to use All Documents view)
Set view = db.GetView("($All)")
Set rtchunk = rtitem.DefineChunk("Everything")
Call rtchunk.ChangeDoclinks("", view.UniversalID)

Changing one component of all doclinks that match a specific component (e.g., changing view unid to use All Documents view if the replica id is the current database)
Set view = db.GetView("($All)")
Set rtchunk = rtitem.DefineChunk("Everything")
Call rtchunk.ChangeDoclinks("", view.UniversalID, "", "", "", Ucase(db.ReplicaID))

Creating a new doclink using AppendLink
Set view = db.GetView("($All)")
Set rtchunk = rtitem.DefineChunk("Everything")
Call rtchunk.AppendLink("", db.ReplicaID, view.UniversalID, doc.UniversalID, "Follow link by clicking here...")

Creating a new hyperlink (link text hotspot) using AppendLink
Set view = db.GetView("($All)")
Set rtchunk = rtitem.DefineChunk("Everything")
Call rtchunk.AppendLink("My link", db.ReplicaID, view.UniversalID, doc.UniversalID, "Follow link by my link...")

What's been said:

No documents found

Have your say:

Name *:
E-mail:
e-mail addresses will not be displayed on this site
Notify me of other comments

Comment *:


<HTML is not allowed>
Linking: Add links as {{http://xxx|title}}, and they will be activated once approved
Blocked? Unable to post a comment? Please read this for a possible explanation...

Copyright © 1996-2008 Genii Software Ltd. All Rights Reserved. Some images courtesy of BigFoto.com  Nedstat