Solved

Creating Folders / not immediately accessible / ACL-Settings

Posted on 2006-06-09
5
844 Views
Last Modified: 2013-12-18
Hi,

I developed a Searchform (only searching in 3 Items).
A Folder containing the corresponding Documents is created on the Fly (for every User).

Now i have two Problems.
1. The User needs to have Manager-Rights (or at least Developer-Rights) in the ACL so he/she can create personal Folders in the Database.
2. The Folder can be only accessed after the Admin/Developer has made a Refresh on the Folders in DB with NotesDesigner

i'm creting the folder with db.enableFolder(foldername).

Is there a Way to solve this?
0
Comment
Question by:ragerino
5 Comments
 
LVL 15

Accepted Solution

by:
Bozzie4 earned 125 total points
Comment Utility
1. No : the user needs the right to create private views in the ACL, but this will work from Author up.
2. ?

this is for the Notes Client, I presume.  If you use the Enablefolder command, you have to close and reopen the database afaik, before the folder shows up in Outlines, design views etc..  I haven't found a good solution.
To solve this , you can use Shared/personal on first use folders.  You just put the documents in the 'shared" folder name (running a script as the logged in user, not as adminsitrator !),  and the private folder will be created.  Disadvantage here is that you can't easily remove the folder anymore

An alternative is to really edit the folder - add access control, modify columns, using NotesView objects and access to the underlying Notesdocument for the folder.   That will allow you to do whatever you want with the folder.

cheers,

Tom
0
 
LVL 3

Author Comment

by:ragerino
Comment Utility
here's my code.
      db.EnableFolder(foldername)
      Set searchfolder=db.getview(foldername)

searchfolder is nothing but i can put documents in it, but i can't show the folder in a frae

ws.settargetframe(myframe)
ws.openview(foldername)

i have to do a F9 with the desinger inside the folders.
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 125 total points
Comment Utility
ragerino,

There is a bug in R6 that was not present in R5 with regard to personal folders.

As a result, the workaround that is used for R5, which is the searchfolder = db.getView(folderName), that would create the view, doesn't work in R6 if the private folder doesn't exist.

Also, the normal things of  coll.putallinfolder("thisFolder", createonFail) doesn't work either.

So, here's my workaround.  

I check for the folder, if it doesn't exist, I use the ws.openDatabase, and set target frame to "_SELF" so I can flash the private folder (which is then created) and then reload the current view.  See sub: CreatePrivateFolder.

In this example, I use an agent, and a default view to test moving documents as well as a Private Shared on First Use folder.  I test to see if the folder exists, if not, create it, then resume the script.

Sub Initialize
      Dim Session As New NotesSession
      Dim ws As New NotesUIWorkspace      
      Const strFolder = "PFV"
      Dim strDb As String, server As String
      server = session.currentdatabase.Server
      strdb =  session.currentdatabase.filepath
      Dim db As NotesDatabase
      Set db = session.currentdatabase
      Dim privateFolder As NotesView
      Set privateFolder = session.currentdatabase.getview(strFolder)
      If privateFolder Is Nothing Then      
            createPrivateFolder db,strFolder
      End If
      Set privateFolder = Nothing
      
      Dim view As NotesView      
      Dim doc As NotesDocument
      Set view = session.currentdatabase.getview("Default")      
      
      'Now put some files in the folder
      Dim count As Integer
      count = 0
      Set doc = view.GetFirstDocument
      While Not doc Is Nothing
            count = count +1
            If count >25 Then Goto NextStep
            If Not doc.IsResponse Or Not doc.IsDeleted Then
                  Call doc.putinFolder(strFolder)
            End If
            Set doc = view.GetNextDocument(doc)
      Wend
      
NextStep:      
      Call ws.openDatabase(server, strdb, strFolder,,True)
      Call  ws.viewrefresh      
      
End Sub

Sub createPrivateFolder(thisdb, strFolderName)
      Dim defaultView As NotesView      
      Dim currentUIView As NotesUIView
      Dim curviewname As String
      
      Dim thisws As New NotesUIWorkspace
      Set currentUIView = thisws.CurrentView
      curviewname = currentUIview.ViewName
      Call thisws.SetTargetFrame("_SELF")
      Call thisws.OpenDatabase(thisdb.server, thisdb.filename,strFolderName)      
      Call thisws.OpenDatabase(thisdb.server, thisdb.filename,curviewname)
      Sleep(5)      
End Sub
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now