Page 1 sur 2
Modifier un chemin d'accès aux archives courriers

Publié:
26 Jan 2010 à 11:32
par stloje
Une nouvelle petite colle :
Quelqu'un a déjà modifié (en LS bien sûr) les chemins d'accès aux bases d'archives de courriers à partir de la V7?
J'ai regardé le bouton et il y a un appel à la méthode EditArchiveSettings() de la classe NotesUIDatabase et là, c'est caduc (voir lien dessous)!
http://forum.dominoarea.org/functions-lotus-script-pour-la-v7-t19916,search_id,33595753.html

Publié:
26 Jan 2010 à 12:12
par stloje
J'ai cherche dans tous les masques et sous-maques et il n'y a aucune trace d'archive.

Publié:
26 Jan 2010 à 12:14
par Michael DELIQUE
de mémoire c'est stocké dans u doc profil donc modifiable

Publié:
26 Jan 2010 à 12:21
par stloje
C'est pour cela que je cherche le masque ou sous-masque contenant les champs, mais j'ai pas trouvé
J'ai déjà fait cela, mais en V4. Je ne m'attendais pas à une évolution aussi grande!

Publié:
26 Jan 2010 à 12:30
par Michael DELIQUE
pas été mettre mon nez dedans depuis un momment...
pourrais pas en dire plus et la mon client en bloqué par un traitement

Publié:
26 Jan 2010 à 12:42
par stloje
Michael, est-ce qu'il est possible d'accéder à des documents de profil sans connaître leur nom? Il doit bien y avoir une astuce?

Publié:
26 Jan 2010 à 12:48
par Michael DELIQUE
salut
essay ça
- Code : Tout sélectionner
Public Function DocProfilList(wDBCible As NotesDatabase) As Variant
Dim lstName List As String
Dim lstRetour List As String
Dim Collection As notesDocumentCollection
Dim Doc As NotesDocument
Dim Key As String
Dim Form As String
Dim i As Integer
On Error Goto errorHandler
If wDBCible Is Nothing Then
Error 9999,"wDBCible is Nothing"
Exit Function
End If
Set Collection = wDBCIble.GetProfileDocCollection("")
If Not Collection Is Nothing Then
If Collection.Count > 0 Then
Set Doc = Collection.GetFirstDocument
While Not Doc Is Nothing
Form = Trim(Doc.GetItemValue("Form")(0))
Key = Trim(Doc.NameOfProfile)
If Key = "" Then
lstName(Form+Key) = Form
Else
lstName(Form+Key) = Form + " (" +Key+")"
End If
Form = ""
Key = ""
Set Doc = Collection.GetNextDocument(Doc)
Wend
End If
Set Collection = Nothing
End If
Set Collection = wDBCIble.GetProfileDocCollection()
If Not Collection Is Nothing Then
If Collection.Count > 0 Then
Set Doc = Collection.GetFirstDocument
While Not Doc Is Nothing
Form = Trim(Doc.GetItemValue("Form")(0))
Key = Trim(Doc.NameOfProfile)
If Key = "" Then
lstName(Form+Key) = Form
Else
lstName(Form+Key) = Form + " (" +Key+")"
End If
Form = ""
Key = ""
Set Doc = Collection.GetNextDocument(Doc)
Wend
End If
Set Collection = Nothing
End If
i=0
Forall value In lstName
If Trim(Cstr(value)) <> "" Then
lstRetour(i) = Trim(Cstr(value))
i=i+1
End If
End Forall
Erase lstName
DocProfilList = lstRetour
Erase lstRetour
Exit Function
errorHandler:
Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
Erase lstName
Erase lstRetour
lstRetour(0) = ""
DocProfilList = lstName
Erase lstRetour
Exit Function
End Function

Publié:
26 Jan 2010 à 12:52
par stloje
Ok, j'essaie cela et je te tiens au courant!

Publié:
26 Jan 2010 à 13:00
par Michael DELIQUE
j'ai corrigé la fonction il y avait un truc qui n'allait pas

Publié:
26 Jan 2010 à 14:04
par stloje
Michael, j'ai voulu faire le malin avant d'exécuter ton code
J'ai lancé le débugger LS et j'ai appuyé sur le bouton Outil -> Paramètres d'archivage. Tout allait bien, jusqu'à ce que j'arrive à instruction mythique Call uidb.EditArchiveSettings() et là, pouf!

Plus rien! Impossible de suivre en débugger.
Je vais chercher dans les agents d'archivages et après j'exécute ce que tu m'as envoyé!

Publié:
27 Jan 2010 à 01:16
par roubech
je dois avoir un bout de code au bureau ...
Sinon, le principe :
checher le doc profil ArchiveProfile
parcourir le champ listant les différents critères d'archivage
pour chaque critère, chercher le doc profil correspondant
pour modifier le champ qui va bien
utiliser NotesPeek ou ScanEZ pour consulter les docs profil de la base et voir le nom des champ
ou si t'as pas, voir le code de Michael et doc.Items pour ensuite avoir la liste des champs
voir si tu ne peux pas tout simplement créer des politiques de criteres d'archivage
et d'autres sujets :
http://forum.dominoarea.org/archives-t21533.html
http://forum.dominoarea.org/affichage-d ... 18630.html
http://forum.dominoarea.org/affichage-d ... 18630.html
et j'aurais du commencer par celui là
http://forum.dominoarea.org/archive-active-t13827.html
qui te renvoi sur ce sujet avec un exemple de code :
http://domino-dev.dominux.net/dominux/D ... dSection=7

Publié:
27 Jan 2010 à 07:44
par billbock
Voici comment je fais pour changer les parametres d'archivage :
- Code : Tout sélectionner
Sub ModifyArchiveParameter
Dim ArchiveProfileDoc As NotesDocument
Dim ArchiveSettingsDoc As NotesDocument
Dim listeArchiveSettings As Variant
Dim dbMail As NotesDatabase
Dim arc As Integer
Dim repnotes As String
Dim path As String
repnotes = doc.NotesPath(0)
'Récupération de la boite mail
Set dbMail = DBOpenMailbox(False)
If Not DbMail.IsOpen Then
Exit Sub
End If
'Modification du profil d'archivage
Set ArchiveProfileDoc = dbMail.GetProfileDocument("Archive Profile")
If ArchiveProfileDoc Is Nothing Then
Exit Sub
End If
'Passage sur serveur
ArchiveProfileDoc.ArchiveOnClientOrServer = "2"
ArchiveProfileDoc.ArchiveServer = serveur
For arc = 0 To Ubound(listeArchive)
If Instr(Strtoken(listeArchive(arc),";",2),repnotes) <> 0 Then
path = Strright(Strtoken(listeArchive(arc),";",2),repnotes)
Else
path = Strtoken(listeArchive(arc),";",2)
End If
'insertion du chemin vers l'archive sur serveur
If (ArchiveProfileDoc.ArchivePath(0) = path) Or (ArchiveProfileDoc.ArchivePath(0) = repnotes + path) Then
ArchiveProfileDoc.ArchivePath = basearc +Strtoken(listeArchive(arc),";",4)
Exit For
End If
Next
Call ArchiveProfileDoc.computewithform(True,True)
Call ArchiveProfileDoc.Save(True,True)
'recuperation des Critères d'archivage
listeArchiveSettings = ArchiveProfileDoc.ArchivePrivatePolicyList
Forall crit In listeArchiveSettings
Set ArchiveSettingsDoc = dbMail.GetProfileDocument(crit)
If not ArchiveSettingsDoc Is Nothing Then
ArchiveSettingsDoc.ArcSlctAge = "2"
For arc = 0 To Ubound(listeArchive)
If Instr(Strtoken(listeArchive(arc),";",2),repnotes) <> 0Then
path = Strright(Strtoken(listeArchive(arc),";",2),repnotes)
Else
path = Strtoken(listeArchive(arc),";",2)
End If
If (ArchiveSettingsDoc.ArchivePath(0) = path) Or (ArchiveSettingsDoc.ArchivePath(0) = repnotes + path) Then
ArchiveSettingsDoc.ArchivePath = basearc +Strtoken(listeArchive(arc),";",4)
Exit For
End If
Next
ArchiveSettingsDoc.ArcAgeUnits = "3"
ArchiveSettingsDoc.ArcAgeNum = "100"
Call ArchiveSettingsDoc.computewithform(True,True)
Call ArchiveSettingsDoc.Save(True,True)
End If
End Forall
End Sub

Publié:
27 Jan 2010 à 08:17
par eru
Et via une policies ?

Publié:
27 Jan 2010 à 09:02
par Michael DELIQUE
salut billbock
interressante ta fonction mais il manque tout un tas de variable qui ne sont pas déclaré ni renseigné (listeArchive , basearc , doc.NotesPath(0) )

Publié:
27 Jan 2010 à 10:08
par stloje
Merci à tous!
J'avais trouvé la réponse hier, mais il était trop tard pour que je mette la solution dans le forum.
Etant donnée que je veux modifier uniquement les chemins d'accès, je ne me suis pas attardé aux autres champs. La version sur laquelle j'ai fait les recherches est la V7
Il y a bien un document de profile d'origine à tous les autres pour l'archivage. Il est accessible par la clé suivante : "archive profile"
J'ai vue dans le code de billbock que la clé était en majuscule sur la première lettre pour faire "Achive Profile". Est-ce du à la version? Aucune idée.
Il y a un champ important, celui qui contient la liste de mots clés des autres documents de profile. Il se nomme "ArchivePrivatePolicyList". Cette liste correspond à celle paramétré par l'utilisateur lorsqu'il modifie son archivage.
Un autre champ a attiré mon attention. C'est celui qui contient le chemin d'accès du premier élément de la liste d'archivage. Il se nomme "archivePath". J'ai fait différents tests et je ne pense pas que Notes utilise ce champ à partir de la V7 puisque chaque entrée d'archivage contient son propre chemin d'accès.
Maintenant, il faut accéder aux documents "enfants". Il ne sont pas enfants à proprement dit, mais ils dépendent d'un document maître. Comme mentionné plus haut, on utilise la liste "ArchivePrivatePolicyList" pour rechercher les documents de profil. Le champ "archivePath" revient dans ce dernier et c'est lui qui est important. Il contient le chemin d'accès pour la base d'archive.
J'ai remarqué aussi, dans le code de billbock, qu'il y a un computeWithForm. Le masque déclaré dans le document maître est bien "Archive Profile", mais le masque ou sous-masque n'existe pas en V7. J'imagine qu'il existe pour les versions antérieures.
Voila ce que j'ai trouvé.
Pour ce qui est des autres champs, toute explication est bienvenue!