Solved

Creating Folders / not immediately accessible / ACL-Settings

Posted on 2006-06-09
5
849 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
ID: 16869740
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
ID: 16869964
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
ID: 16877079
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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