Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
propertiesCmd
Rooose
Hi there,
I'm trying to show the properties dialog for a search or document folder and get the following error: Could not get database(s) collection
I've supplied the 2 context items the documentation mentions
Here is the code:
Public Function showProperties(ByVal pHWND As Long, _
ByVal pMoniker As String)
Dim lPropertiesCmd As Imanextlib.PropertiesCmd
Dim lContextItems As Imanextlib.ContextItems
Dim lFolder As IManFolder
Set lContextItems = New Imanextlib.ContextItems
Set lPropertiesCmd = New Imanextlib.PropertiesCmd
Set lFolder = vWorksite.GetObjectBySID(pMoniker)
lContextItems.Add "ParentWindow", pHWND
lContextItems.Add "SelectedFolderObject", lFolder
lPropertiesCmd.Initialize lContextItems
lPropertiesCmd.Update
If lPropertiesCmd.Status = 0 Then _
lPropertiesCmd.Execute
Set lFolder = Nothing
Set lPropertiesCmd = Nothing
Set lContextItems = Nothing
End Function
Thanks in advance for any help
RW
Find more posts tagged with
Comments
jny
The approriate command object to use is the FolderACLCmd. Code example below.
Option Explicit
Private Sub Form_Load()
On Error GoTo Oops
Dim cmd As IMANEXTLib.FolderACLCmd
Dim context As IMANEXTLib.ContextItems
Dim dms As New IManage.NRTDMS
Dim sess As IManage.NRTSession
Dim objNewFolder As IManage.NRTFolder
Dim objFolder As IManage.NRTFolder
Dim server As String
Dim user As String
Dim pwd As String
Dim bRefresh
' Using IMan Interface for folder searching...
Dim idms As ManDMS
Dim ifsp As IManFolderSearchParameters
Dim iDBs As New ManStrings
Dim i As Integer
' AdditionalProperties arrays
Dim arrAttributeName(0) As String
Dim arrAttributeValue(0) As String
arrAttributeName(0) = "iMan___5"
arrAttributeValue(0) = "GUEST"
' Hardcode login input
server = "NTDEVSUPPORT"
user = "jyee"
pwd = "mhdocs"
Set sess = dms.Sessions.Add(server)
sess.Login user, pwd
Set idms = dms
For i = 1 To sess.Databases.Count
iDBs.Add (sess.Databases(i).Name)
Next i
Set ifsp = idms.CreateFolderSearchParameters
ifsp.Add imFolderName, "6cares Folder"
Set objFolder = idms.Sessions.ItemByIndex(1).WorkArea.SearchFolders(iDBs, ifsp).ItemByIndex(1)
Set context = New IMANEXTLib.ContextItems
Set cmd = New IMANEXTLib.FolderACLCmd
' Add required values
'context.Add "SelectedPageFolderObject", objFolder
' SelectedPageFolderObject could be an NRTDocumentFolder Object under a page or Null
context.Add "DestinationObject", sess.PreferredDatabase
' DestinationObject could be an NRTSession or NRTDatabase Object
context.Add "IManExt.CreateNewFolder", True
context.Add "IManExt.NewFolderType", imTypeDocumentFolder
' Optional values
context.Add "IMANEXT.NewFolderName", "Custom"
context.Add "IMANEXT.NewFolderDescription", "Description"
'context.Add "IManExt.HideGeneralTab", true
'context.Add "IManExt.HideProfileTab", True
context.Add "IManExt.FolderACLDlg.Caption", "capTab"
context.Add "IManExt.FolderAdditionalPropertyNameArray", arrAttributeName
context.Add "IManExt.FolderAdditionalPropertyValueArray", arrAttributeValue
'context.Add "IManExt.DisableModifyFolderName", True
'context.Add "IManExt.FolderACLDlg.Tab1Caption", "capTabl"
'context.Add "IManExt.FolderACLDlg.Tab2Caption", "capTab2"
'context.Add "IManExt.FolderACLDlg.Tab3Caption", "capTab3"
' Profiling
Dim arrProfiles() As Variant
ReDim arrProfiles(0)
arrProfiles(0) = nrCustom3
' restrict profile fields
context.Add "IManExt.FolderACLDlg.ProfileFieldsPopupList", arrProfiles
cmd.Initialize context
cmd.Update
cmd.Execute
bRefresh = context.Item("IManExt.Refresh")
If True = bRefresh Then
Set objNewFolder = context.Item("IManExt.NewFolderObject")
End If
GoTo Cleanup
Oops:
MsgBox Err.Description
Err.Clear
Resume Next
Cleanup:
Set objNewFolder = Nothing
Set cmd = Nothing
Set context = Nothing
Set sess = Nothing
Set dms = Nothing
End
End Sub