Autor Thema: Ansichtseigenschaften übertragen  (Gelesen 2497 mal)

Offline AndreasG

  • Frischling
  • *
  • Beiträge: 35
  • Geschlecht: Männlich
  • Ich liebe dieses Forum!
Ansichtseigenschaften übertragen
« am: 03.11.03 - 12:04:43 »
Hallo!

Einfache(hoff ich doch) Frage:
Ich hab in einer Datenbank so etwa 150 Ordner,
die alle den gleichen Stil haben(gleiche Spalten etc).
Wenn ich nun eine zusätzliche Spalte einbauen will,
wie kann ich dafür Sorgen, dass diese Spalte in allen
Ordnern und Ansichten angezeigt wird?
Gibts da ne bessere Möglichkeit, als alle Ordner zu löschen
und neu zu erstellen?...ausserdem wenn ich das über script mache erstellt er mir alle Ordner mehr als einmal...
Vielleicht hatte hier ja jemand schonmal das Problem.

Glombi

  • Gast
Re:Ansichtseigenschaften übertragen
« Antwort #1 am: 03.11.03 - 12:16:23 »
Hi,
das geht mit @UpdateViewDesign - aus der KBase:

To solve this issue, an undocumented @function called @UpdateViewDesign can be used.  This @function exists in Notes R5 Client and Domino R5 Designer, and will update the design of one view or folder with another specified by the @Function.  

@UpdateViewDesign(targetView, sourceView)

targetView - view or folder having its design replaced

sourceView - view or folder design used to update the targetview

IMPORTANT NOTE: The sample "Update View Designs" agent below uses the LotusScript IsFolder property (of the NotesView class).  The sample agent  opens every design note to check whether or not it is a folder.  The IsFolder's current design requires the view/folder to be opened in order to determine whether or not it is a view or folder.  In doing so it ends up building an index for every design note it touches just as if the user were to open the view or folder manually, via the GUI.  Indexes are built for hidden views as well.  Therefore, the database grows in size after running the agent because every view and folder has been indexed regardless if the user ever touched it or used it.   Lotus Software is aware of this issue.  Refer to the document, "Using the LotusScript NotesView-Classes IsFolders Property Causes View Index to be Built or Rebuilt" (#197914).


IMPORTANT NOTE:  This workaround should not be used with releases of Notes R5 prior to 5.0.3 because there was a problem with the @UpdateViewDesign function in prior releases.  Refer to the Supporting Information section below for more information. @UpdateViewDesign is considered undocumented; customers must use it at their own discretion.


In order to update all of the folders or views in a database the @UpdateViewDesign function could be used in a LotusScript agent.  The example below demonstrates how to use the UpdateViewDesign function to update a user's folders within their Mail file.

The following agent uses the Inbox design as the replacement parameter.  Every folder (except the standard folders) is replaced with the R5 Inbox design.  If there are folders that exist in the template that are erroneously updated, then the database's design must be refreshed after these agents have been run in order to get them correctly back into the mail file.

Note:  The Notes Client must be restarted after running the agents for the design update to take effect.

IMPORTANT NOTE:  The following is a sample script, provided only to illustrate one way you can approach this functionality.  Notes Support does not support this script and will not be able to customize it for a customer's specific configuration.

Update View Designs - LotusScript

Sub Initialize
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim profile As NotesDocument
   Dim item As NotesItem
   Dim agent As NotesAgent
   
   Dim macro_pre As String
   Dim macro_post As String
   Dim macro As String
   
   Dim ignore_list List As Integer
   Dim view_name As String
   Dim front As String
   Dim back As String
   Dim slashpos As Integer
   
 'Strings to build the evaluate macro dynamically
   macro_pre = |@UpdateViewDesign("|
   macro_post= |"; "($Inbox)") |
   
   Set db = session.CurrentDatabase
   
 'Build the list of views to ignore
   ignore_list("($Inbox)") = 1
   ignore_list("(Rules)") = 1
   ignore_list("(Group Calendars)") = 1
   ignore_list("($Trash)") = 1
   ignore_list("($Alarms)") = 1
   ignore_list("($Contacts)") = 1
   ignore_list("($Calendar)") = 1   
   ignore_list("(To do's\By Category)") = 1
   ignore_list("(To do's\By Status)") = 1
   ignore_list("($Meetings)") = 1
   ignore_list("Trash") = 1
   ignore_list("(Discussion Threads)") = 1
   ignore_list("($All)") = 1
   ignore_list("($Drafts)") = 1
   ignore_list("($HeadlinesView)") = 1
   ignore_list("($Sent)") = 1
   ignore_list("($SoftDeletions)") = 1
ignore_list("($ToDo)") = 1
   ignore_list("Stationery") = 1
   ignore_list("($FolderInfo)") = 1
   ignore_list("($FolderRefInfo)") = 1
   ignore_list("($VIM98)") = 1
   ignore_list("($VIM42)") = 1
   ignore_list("($VIM256)") = 1
   ignore_list("($VIM23)") = 1
   ignore_list("($VIM100)") = 1
   ignore_list("($RepeatLookup)") = 1
   ignore_list("($Profiles)") = 1
   ignore_list("($POP)") = 1
   ignore_list("($POPUIDL)") = 1
ignore_list("($POP3)") = 1
   ignore_list("($PeopleGroupsFlat)") = 1   

   Forall v In db.Views
  'Just get the view name one time and store it rather than continually accessing it
      view_name = v.Name
      
      If v.IsFolder And (Iselement( ignore_list(view_name)) = False) Then
         
   'We do this next bit so slashes don't get stripped out of the view name when passed to UpdateViewDesign
         slashpos = Instr( view_name, "\" )
         
         While slashpos
            view_name = Left(view_name, slashpos) & "\" & Right( view_name, _
            Len(view_name) - slashpos)
            slashpos = Instr(slashpos+2, view_name, "\" )
         Wend    
         
   'Now build the macro and execute it on the fly
         macro = ( macro_pre & view_name & macro_post)
         Evaluate( macro )
         
      End If
   End Forall
End Sub


Offline AndreasG

  • Frischling
  • *
  • Beiträge: 35
  • Geschlecht: Männlich
  • Ich liebe dieses Forum!
Re:Ansichtseigenschaften übertragen
« Antwort #2 am: 03.11.03 - 14:38:47 »
Cool!

Ich wusste hier weiss jemand ne Antwort ;D
Vielen Dank Glombi!
...verrätst Du auch woher Du Kenntnis von undokumentierten
Funktionen hast?

Glombi

  • Gast
Re:Ansichtseigenschaften übertragen
« Antwort #3 am: 03.11.03 - 14:45:27 »
In diesem Fall aus dem Mailfile. Da gibt es eine Aktion "Ordner auf aktuelle Gestaltung migrieren" oder so ähnlich. Da wird diese Funktion verwendet.

Das Mailfile sowie diverse andere Schablonen (privates Adressbuch, Teamroom) ist ein Hort von undokumentieren Funktionen...

Wenn man Glück hat, findet man hier, unter www.lotus.com/ldd oder in der Knowledge Base was dazu. Es gibt auch noch etliche andere Internetseiten...

Andreas

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz