Autor Thema: Profildokumente löschen  (Gelesen 2972 mal)

Offline LordDestiny

  • Frischling
  • *
  • Beiträge: 15
  • Geschlecht: Männlich
Profildokumente löschen
« am: 21.11.02 - 14:22:31 »
Hi,

habe in einer DB das Problem, dass ich gelöschte Profildokumente selbst mit 'HardDeleteDocument' nicht mehr rausbekomme, nachdem sie auf Softdelete umgestellt wurde.
Jedes andere Dokument ist ohne Probleme ganz aus der Datenbank zu löschen, oder auch wiederherzustellen. Habe leider in der Noteshilfe nichts gefunden, was mir da weiterhelfen könnte.
Weiss jemand von euch, ob es eine Möglichkeit gibt, Profildokumentebei o.g. Einstellungen trotzdem komplett aus der DB zu löschen?

Gruss,
LD

Offline ata

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 5.092
  • Geschlecht: Männlich
  • drenaiondrufflos
    • Anton Tauscher Privat
Re:Profildokumente löschen
« Antwort #1 am: 21.11.02 - 14:43:32 »
... hast du es auch mit LotusScript probiert?

Profildokumente haben eine Sonderstellung. Sie erscheinen in keinen Ansichten, werden beim Starten der DB in den Cache geladen usw.usf.

Wie hast du beisher versucht ein Profildokument zu löschen?

Übrigens wäre die Frage bei "R5 Problem Forum" oder "Entwicklung" besser angebracht...

ata
Grüßle Toni :)

Offline wflamme

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 690
  • Geschlecht: Männlich
  • Irgendwie geht das schon...
    • wflamme
Re:Profildokumente löschen
« Antwort #2 am: 22.11.02 - 03:12:36 »
HTH:

Tip:
        Display Profile Documents in a view
 Author:
        Catalin Popescu
 Date:
        02 Jul 2001
 Rating:
        3.90 (out of 5 - Please Register or Log In to rate this tip.)




 Tips Summary

 The "getProfileDocuments" agent creates a stub document for every profile document in a database. Every newly created
 document has a rich text field with a doclink to a profile document. The form used for the creation of the stub documents has
 AutoLaunch setting "- First Document Link" so the user could open, edit and save the profile documents directly from view.
 Caution! Deleting the stub documents from the view does not affect the profile documents. Instead, please see the agent named
 deleteProfileDocuments below. Also, the paste operation in the profiles view should be restricted through the QueryPaste event.
 The form and view could have supplementary fields depending of the profile documents structure and user needs.

 Code

 Create a "Profile" Form used for stub documents creation that contains the following fields:

 ProfileName Text
 UserName Text
 Body RichText
 Profile_UNID Text

 AutoLaunch form setting -First Document Link-

 Create a "ProfilesView" View used for profile documents display. The view could have the following columns:

 Column 1 - ProfileName
 Column 2 - UserName

 The Paste operation should be restricted in the ProfilesView view.

 Sub Querypaste(Source As Notesuiview, Continue As Variant)
         Messagebox     ("You cannot paste documents in this view!")
         Continue = False
 End Sub


 getProfileDocuments agent:
 Sub Initialize
         Dim s As New NotesSession
         Dim db As New NotesDatabase("czms", "isys/isys100_.nsf")
         Dim vc As NotesViewEntryCollection
         Dim col As NotesDocumentCollection
         Dim doc, doc_ref  As notesdocument
 '       get a handle to all profile documents in database
         Set col = db.GetProfileDocCollection("")
         If Not col.count = 0 Then
                 Set doc = col.GetFirstDocument          
         Else
                 Messagebox ("There are no profile documents !")
                 Exit Sub
         End If
 '       delete the previously created stub documents
         Set view = db.GetView( "ProfilesView" )
         Set vc = view.AllEntries
         Call vc.RemoveAll(True)
 '       create stub documents                  
         While Not doc Is Nothing        
                 Set doc_ref = db.CreateDocument
                 doc_ref.Form = "Profile"
 '       get the name of the profile doc
                 doc_ref.ProfileName = doc.NameOfProfile
 '       get the name of the key attached to the profile doc    
                 doc_ref.UserName = Strrightback(doc.getItemValue("$Name")(0), "_")
 '       get the UniversalID of the profile doc - field used by deleteProfileDocuments agent    
                 doc_ref.Profile_UNID = doc.UniversalID
                 Set rt_item = New NotesRichTextItem( doc_ref, "Body" )
 '       create the doclink to the profile doc  
                 Call rt_item.AppendDocLink( doc,  doc.getItemValue("$Name")(0))
                 Call doc_ref.save(True, True)  
                 Set doc = col.GetNextDocument(doc)
         Wend
 End Sub

 The "deleteProfileDocuments" agent is an example of how to delete selected profiles form the ProfilesView view.

 Sub Initialize
         Dim s As New NotesSession      
         Dim db As NotesDatabase
         Dim doc_ref, doc_profile As NotesDocument
         Dim coll As NotesDocumentCollection
         Set db = s.CurrentDatabase
         Set coll=db.UnprocessedDocuments
         For i = 1 To coll.count
                 Set doc_ref = coll.GetNthDocument(i)
                 Set doc_profile = db.GetDocumentByUNID ( doc_ref.Profile_UNID(0) )              
                 'Delete profile doc
                 doc_profile.Remove(True)
                 'Delete stub doc
                 doc_ref.Remove(True)
         Next
 End Sub
Grüße,
Wolfgang

"I love deadlines. I love the whooshing sound they make as they pass by..."
DOUGLAS ADAMS

wflamme@mainz-online.de
http://www.sns1.de/partner/flamme/wflamme.nsf

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz