Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Toma Bogdan am 19.10.02 - 14:24:26
-
The situation:
- database A with doc X
- database B with doc Y
- database C with 0 doc
I create a doclink to Y (placed into db B) from into doc X (placed into db A) with AppendDocLink from an scheduled agent ! Then I move the doc Y from database B to database C !
How can I make it so the link from doc X (placed into db A) to route to doc Y (placed into db C) ?
PS If there are many docs from db A that have a link to the same doc Y (even this have been moved to the db C), how can I proceed to have a good link ?
thanks !
-
in the moment you move the doc to a new db you have to place actively a new doclink and delete the first doclink. There is no updating method. BUT if you have more then one doclink in docX you have serious probs to identify the right link. You may find a reserved field "$links" but you cant work with them in LS. There is no known method to handle doclinks with LS at all, there are just some turn arounds with Notes API (look at the gold forum at http://www-10.lotus.com/ldd).
-
It seems that another ideea is when I move the doc Y from db B to db C to check all the docs from db A to see if these are related to doc Y (use NoteID - it is unique in a db) and if the link (NoteID+CrtDbName) isn't valid to rebuild the DocLink with NoteID+NewdbName !
it is a good idea ?
-
to trigger such an event "on the fly" you should choose the view event "Query Paste" and the database event "QueryDocumentDelete" (depending on the given process en detail).
But once again: in your first posting you refered to the notes in-built "doclink" object, now you´re speaking about another kind of relation. However, true doclinks arent accessable by Script or any other built-in Notes method, just Notes API (which i dont know about). Whatever kind you choose, you can trigger it as aforementioned.
Couldnt you generate something in a way of a mapping table? A central document, inheriting all doc-relationships. Any movement is logged through and about that document. No doc-links, just
1. "Doc A.."UNID" > inherited in "Doc B" .."UNID"
2. "Doc C.."UNID" > inherited in "Doc E" .."UNID"
...
based on this you could design your further needs
-
yes, I can use the Postdocumentdelete or Querydocumentdelete event to control the update of the docLink (with the AppendDocLink method).
When I move the doc Y from db B to db C, I will delete the doclink of the doc X and then I will updated it (create again) with a new doclink to the doc Y from the db C !
With this method I don't need to use another form into db A or a doc to keep all doc-relationships ! Isn't it ?
:o
-
yes, ;D with deleting the old and creating the new doclink i wouldnt say no more that you´re getting in trouble with that kind of "updating" ;D ;D
Really, R6 is nice, but this kind of HTML Link Checking ... it is that ... waiting for Rel 42 8)
-
x ! I will try and maybe ....we will talk after this :-X
-
that Notes API part = there is another thread at spotlight.de with a very similar question. A guy named "Odi2000" claims to have a .dll which reads the doclinks in a document and is able to find with getdocumentbykey the referenced docs. He´s willing to share his .dll if he´s mailed.
look here:
http://spotlight.de/zforen/lts/m/lts-1035206853-11693.html
if you try it out, please inform me about :)
-
... if there is no need for to work with the standard Notes-doclinks, there is a possibilty to work with .ndl-Files (Notes-Doc-Link)...
ata
-
- rob, I wrote to Odi2000 from http://spotlight.de/zforen/lts/m/lts-1035206853-11693.html but nothing until now....
- ata, how can I work with "ndl-Files" ?
-
i dont know personally this guy, so i cant tell if he´s just a faker or not. :-\
-
... to do it by hand:
1. Copy the document as DocLink
2. Open your editor and paste your clipboard
3. Save the file with the extension ".ndl"
4. Attach the file in your document
... to do it with an agent:
Create a button in the document that does:
@Command([EditMakeDocLink]) ;
@Command([ToolsRunMacro]; "SendNDL")
Here is the "SendNDL" Agent:
'[Options]
Option Public
Public Const CF_TEXT = &H001
'[Delcarations]
Declare Function OpenClipboard Lib "User32.dll" Alias "OpenClipboard" (Byval hWnd As Long) As Long
Declare Function GetClipboardData Lib "User32.dll" Alias "GetClipboardData" (Byval wFormat As Integer) As String
Declare Function CloseClipboard Lib "User32.dll" Alias "CloseClipboard" ( ) As Long
'[Initialize]
Sub Initialize
Dim Status As Long
Dim ptr As Long, ghand As Long,handle As Long
Dim Text As String
Dim SendTo As String
Dim s As New notessession
Dim db As NotesDatabase
Dim doc As notesDocument
Dim rtitem As NotesRichTextItem
Set db = s.currentdatabase
Set doc = db.CreateDocument()
' Control of platform 16/32-Bit
If Instr(s.platform,"16") Then
Messagebox ("Wrong Windows-platform; this agent runs only under Windows NT/95")
Exit Sub
End If
' open clipboard
Status = OpenClipboard(handle)
If Status <> 0 Then
' reading clipboard contents
Text = GetClipboardData(CF_TEXT)
Status = CloseClipboard()
Else
Messagebox ("Error opening the clipboard!")
Exit Sub
End If
'Create .ndl file
File = s.GETENVIRONMENTString("Directory",True) &"\link.ndl"
iFileNumber = Freefile
Open File For Output As iFileNumber
Print #iFileNumber, Text
Close #iFileNumber
'Send message
doc.Form = "Memo"
doc.SendTo = "address@email.com"
doc.Subject = "Test NDL"
Set rtitem = doc.CreateRichTextItem("Body")
Call rtitem.EmbedObject ( EMBED_ATTACHMENT, "", File)
doc.send True
Kill File
End Sub
... Thats it => i found it in eknori'es Schatzkiste...
ata
-
interesting....
-
... if you search in the notes.net forum by ".ndl" you will find a statemanet, where the syntax of all the parameters is declared...
Is it a way for you?
ata
-
... i forgot...
... if you know the syntax of this text-file, you can create one - this works on other platforms than "Windoof" too...
ata
-
x ! I will read more about it.... ::)