• Browse Blogs
  • My Blog
  • My Updates

+Tags Get help with tags?

  • View as cloud  | list

+ Similar Blogs

photo

Yellow is the...

72 Entries |  Tim Tripcony
Updated 
RatingsRatings 2     CommentsComments 34
photo

Lotus Nut

111 Entries |  Chris Whisonant
Updated 
RatingsRatings 23     CommentsComments 157
photo

Patrick Picar...

62 Entries |  Patrick Picard
Updated 
RatingsRatings 2     CommentsComments 112
photo

Urs Meli

42 Entries |  Urs Meli
Updated 
No RatingsRatings 0     CommentsComments 48
photo

TexasSwede

109 Entries |  Karl-Henry Martinsso...
Updated 
No RatingsRatings 0     CommentsComments 94

+ Bookmarks

+ Blog Authors  

All entries tagged with folders

1 - 2 of 2
  • Previous
  • Next
  • Page   1

Adding Datasets & Datagrids to Notes Applications - Part 2

Peter Presnell |   | Tags:  .dominoframework dataset folders datagrid | Comments (0)  |  Visits (688)
In part 1I discussed the concept of a dataset and how it can be applied to Notes application.  While Notes views are a representation of a dataset I wanted to focus on the opportunities of generating the dataset at run time.  e.g. it becomes possible to take input from the application/user to build the data collection.

Internally, the easiest way to represent a dataset is a NotesDocumentCollection.  One of the issues with this class is there is presently no easy way to store such a dataset, even for the duration of a session.  Nor is there an easy way to display its contents within an application.  Notes provides views/folders as the only effective way of displaying a collection of documents.
  1. Views have a number of issues..  The contents of a view are based upon a specified selection formula.  Once created a large amount of server resources are devoted to manitaining the contents of views each and every time the contents of database change.  For this reason the number of views in an application (especially large applications) should always be kept to a practical minimum.
  2. Folders seems a much better match for a dynamic run-time dataset as they provide the same basic look/feel but do not carry an overhead to maintan their content.  The process of taking a document collection and adding it toi a view is a very simple one.
The .Domino Framework's DominoDataset class provides a Rebuild method which takes a dataset and gives it a phyiscal form using folders.  We tare then able to mimic the functionality of a datagrid control using the Notes folder control which can be displayed directly or embedded on a form or page.  To maximize flexibility options exist to:-
  1. Recognize a dataset that already exists as a view
  2. Allow a specific (existing) folder design element to be used.
  3. Allow an existing view/folder to be used as a template for a new folder
  4. Build a new folder from scratch based upon the field defined in the dataset
'/**
' * Place the dataset into a folder so that is able to be displayed
' */
Function Rebuild() As NotesView

Dim Collection As NotesDocumentCollection
Dim Column As NotesViewColumn
Dim Entries As NotesViewEntryCollection
Dim FieldIndex As Integer
Dim Dataset As NotesView

' Locate exisging view/folder

Set Dataset = iDocument.ParentDatabase.GetView(Me.Foldername$)

' For folders, empty the content

If (Not Dataset Is Nothing) Then
If (Dataset.IsFolder) Then
Set Entries = Dataset.AllEntries
Call Entries.RemoveAllFromFolder(Me.Foldername$)
End If
End If

' Add documents to folder

If (Dataset.IsFolder) Then
Set Collection = Me.AllDocuments
Call Collection.PutAllInFolder(Me.FolderName$)
Set Dataset = iDocument.ParentDatabase.GetView(Me.Foldername$)

' Set folder name and alias

If (Dataset.Aliases(0) <> Me.FolderName$) Then Dataset.Aliases = Me.FolderName$
If (Dataset.Name <> Me.Title) Then Dataset.Name = Me.Title$

' For dynamic folders, refresh design of folder.
' If a template view is provided, refersh from that else build the folder design based upon the dataset definition.

If (Me.StoreData$ = ENUM_STORE_DATA__DYNAMIC_FOLDER) Then
If (Me.TemplateView$ = "") Then
If (Not Isempty(Dataset.Columns)) Then
Forall ExistingColumn In Dataset.Columns
Call Dataset.RemoveColumn(ExistingColumn)
End Forall
End If
Forall NewColumn In Me.Fields
Set Column = Dataset.CreateColumn(Dataset.ColumnCount%+1,Cstr(NewColumn),Cstr(NewColumn))
Column.Title$ = Me.Label(FieldIndex%)
If Not (Isnull(Arraygetindex(Me.SortBy,NewColumn))) Then Column.IsSorted = True
FieldIndex% = FieldIndex% + 1
End Forall
Else
Evaluate(|@UpdateViewDesign("| + Me.FolderName$ + |";"| + Me.TemplateView$ + |")|)
Call Dataset.Refresh()
End If
End If
End If

' Refresh the view/folder

Call Dataset.Refresh()
Set Rebuild = Dataset

End Function
The following are some of the features that can be added to an application using the dataset/datagrid approach:-
  1. Provide the functional equivalence of emedding multiple categories of a view
  2. Embed a single category view in which it is still possible to do collapse all/expand all
  3. Provide the ability to export data from an application in which a predefined set of rows (documents) & columns (fields) are exported.  The user can also have the option of selecting which of these columns they wish to export.
  4. Provide an alternative to views without the overhead of maintaining view contents.  For relative static data folder contents can be rebuilt via a scheduled agent.  Datasets used infrequently can have their content built as part of the folders query open event.
  5. Provide a dynamic report buiulding capability
  6. Provides an alternate approach to search building in which the use can even define the columns they wish to see in their search results
No RatingsRatings 0

DragDrop To A View

Peter Presnell |   | Tags:  views dragdrop folders | Comments (0)  |  Visits (527)
By default Notes only supports the dragging/dropping of documents into a folder.  The following is a technique developed for an application allowing the simulation of dragging a collection of documents into a view:-
  • For each view to support drag/drop create a new (dummy) folder.  The design of the folder does not matter as it is never opened/used.
  • Modify any outlines used to link to the dummy folder instead of the original view
  • Place the following code into the QueryOpen event of each dummy folder forcing the associated view (or page with embedded single category view) to open instead of the folder when selected from the outline.
Sub Queryopen(Source As Notesuiview, Continue As Variant)
    Dim UIW As New NotesUIWorkspace
    Continue = False
    Call UIW.SetTargetFrame("NotesView" )
    Call UIW.CurrentDatabase.OpenView("Viewname" )
    or
    Call UIW.OpenPage("Pagename" )
End Sub

  • Modify the database's Postdragdrop event to evaluate continue = false, preventing documents being placed into these dummy folders.
  • Finally, add the code to the Postdragdrop event to perform the  desired task for a collection of documents being "dropped in the view".
 
No RatingsRatings 0

  • Previous
  • Next
Jump to page of 1
Skip to main content link. Accesskey S
IBM Lotus Connections Help Tools About