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)
iCommand issue..
shahbm
Hi there,
I am trying to create a new custom command in Edit Profile.
PROBLEM-1
-----------------
Here is what I've done so far,
- From Dialog Editor, I've added one edit box(custom10 edit) and one lookup button (custom10) into the Edit Profile dialogue
- On my desktop, I've modified the registry under [HKEY_LOCAL_MACHINE\SOFTWARE\Interwoven\WorkSite\8.0\iManExt\Edit Profile Dialog]
- Modified the sample dll (MyVBNetImanExt) and created my own dll
- Compiled and registered the dll and modified the registry(custom10 cmd) to point to my custom dll
- Now when i open desksite and right click on a document and open properties (Edit Profile), i can see my custom textbox and custom button
- When I click on the custom button it opens up a form through which i pass a text value, which comes to my custom edit box (using "ImanExt.SelectedString")
- Prb: now when it comes to the edit box, it comes with a red cross and I can't save the value into that custom field?? Can you pls tell me what do I have to do to fix this. (CHECK OUT THE ATTACHED IMAGE)
PROBLEM-2
-----------------
- can you tell me how can I get that custom field value into my other program, which also implements the icommand.
- here is my sample code and i am getting error while i try to get the selected NRT document object!!
Public Class MyVBNetCmd
Implements IMANEXTLib.ICommand
Private Const tempVirtKey As Integer = 65536
Private Const tempNoInvert As Integer = 131072
Private Const tempShift As Integer = 262144
Private Const tempControl As Integer = 524288
Private Const tempAlt As Integer = 1048576
Private mAccelerator As Integer
Private mBitmap As System.IntPtr
Private mContext As IMANEXTLib.IContextItems
Private mHelpFile As String
Private mHelpID As String
Private mHelpText As String
Private mMenuText As String
Private mName As String
Private mOptions As Integer
Private mStatus As IMANEXTLib.CommandStatus
Private mSubCommands As IMANEXTLib.ICommands
Private mTitle As String
Private mType As IMANEXTLib.CommandType
Public Sub New()
On Error GoTo ClassInitializeError
Name = "VBNetIManExt.MyVBNetCmd"
Title = "List the documents which are selected."
Accelerator = Asc("V") + tempVirtKey + tempControl
Type = IMANEXTLib.CommandType.nrStandardCommand
Status = IMANEXTLib.CommandStatus.nrGrayedCommand
MenuText = "MyVBNETCommand" & vbTab & "Ctrl+V"
HelpText = "Displays the selected documents in a message box by a VB.NET command." & vbCrLf & "Display selected documents."
Dim bm As New Bitmap(Me.GetType(), "VBNETCMD.bmp")
mBitmap = bm.GetHbitmap()
Exit Sub
ClassInitializeError:
End Sub
Public Sub Execute() Implements IMANEXTLib.ICommand.Execute
Dim rpSelectedNRTDocuments As Array
Dim pDocument As Object
Dim sDisplay As String
On Error GoTo ExecuteError
--------''ERROR - THIS LINE IS THROWING ERROR--------------------------
''(value does not fall into the range)
rpSelectedNRTDocuments = mContext.Item("SelectedNRTDocuments")
Dim i As Integer = 0
For i = 0 To rpSelectedNRTDocuments.Length - 1
pDocument = rpSelectedNRTDocuments(i)
---------'HELP - how can i get custom field value here??-------------------
MsgBox(pDocument.GetAttributeByID("Custom10"))
Next i
Exit Sub
ExecuteError:
End Sub
Public Sub Update() Implements IMANEXTLib.ICommand.Update
Dim rpSelectedNRTDocuments As Array
Dim iCountOfSelectedNRTDocuments As Short
On Error Resume Next
rpSelectedNRTDocuments = mContext.Item("SelectedNRTDocuments")
On Error GoTo UpdateError
iCountOfSelectedNRTDocuments = rpSelectedNRTDocuments.Length
If iCountOfSelectedNRTDocuments > 0 Then
mStatus = IMANEXTLib.CommandStatus.nrActiveCommand
Else
mStatus = IMANEXTLib.CommandStatus.nrGrayedCommand
End If
Exit Sub
UpdateError:
End Sub
Public Property Accelerator() As Integer Implements IMANEXTLib.ICommand.Accelerator
Get
Return mAccelerator
End Get
Set(ByVal Value As Integer)
mAccelerator = Value
End Set
End Property
Public Property Bitmap() As Object Implements IMANEXTLib.ICommand.Bitmap
Get
Return mBitmap
End Get
Set(ByVal Value As Object)
mBitmap = Value
End Set
End Property
Public ReadOnly Property Context() As IMANEXTLib.ContextItems Implements IMANEXTLib.ICommand.Context
Get
Return mContext
End Get
End Property
Public Property HelpFile() As String Implements IMANEXTLib.ICommand.HelpFile
Get
End Get
Set(ByVal Value As String)
End Set
End Property
Public Property HelpID() As Integer Implements IMANEXTLib.ICommand.HelpID
Get
Return mHelpID
End Get
Set(ByVal Value As Integer)
mHelpID = Value
End Set
End Property
Public Property HelpText() As String Implements IMANEXTLib.ICommand.HelpText
Get
Return mHelpText
End Get
Set(ByVal Value As String)
mHelpText = Value
End Set
End Property
Public Sub Initialize(ByVal Context As IMANEXTLib.ContextItems) Implements IMANEXTLib.ICommand.Initialize
mContext = Context
End Sub
Public Property MenuText() As String Implements IMANEXTLib.ICommand.MenuText
Get
Return mMenuText
End Get
Set(ByVal Value As String)
mMenuText = Value
End Set
End Property
Public Property Name() As String Implements IMANEXTLib.ICommand.Name
Get
Return mName
End Get
Set(ByVal Value As String)
mName = Value
End Set
End Property
Public Property Options() As Integer Implements IMANEXTLib.ICommand.Options
Get
Return mOptions
End Get
Set(ByVal Value As Integer)
mOptions = Value
End Set
End Property
Public Property Status() As Integer Implements IMANEXTLib.ICommand.Status
Get
Return mStatus
End Get
Set(ByVal Value As Integer)
mStatus = Value
End Set
End Property
Public Property SubCommands() As IMANEXTLib.Commands Implements IMANEXTLib.ICommand.SubCommands
Get
Return mSubCommands
End Get
Set(ByVal Value As IMANEXTLib.Commands)
mSubCommands = Value
End Set
End Property
Public Property Title() As String Implements IMANEXTLib.ICommand.Title
Get
Return mTitle
End Get
Set(ByVal Value As String)
mTitle = Value
End Set
End Property
Public Property Type() As IMANEXTLib.CommandType Implements IMANEXTLib.ICommand.Type
Get
Return mType
End Get
Set(ByVal Value As IMANEXTLib.CommandType)
mType = Value
End Set
End Property
End Class
Thx in advance..
B
Find more posts tagged with
Comments
Migrateduser
One thing is do not use
MsgBox(pDocument.GetAttributeByID("Custom10"))
use
MsgBox(pDocument.GetAttribute
Value
ByID(
34
))
Get the Value, not the attribute, and pass the correct identifier for the attribute:
34 = Custom 10 Alias
shahbm
Hi there,
Thx for your reply, but I am not getting to the point where i have pDocument object!!
my code fails at the following line:
rpSelectedNRTDocuments = mContext.Item("SelectedNRTDocuments")
ERROR" "Unable to cast object of type 'System.Object[]' to type 'Imanage.NRTDocument[]'.
Can u pls tell me what am I doing wrong here?
B
Migrateduser
The error is pretty clear.
Don't
Dim pDocument As Object
but
Dim pDocument As NRTDocument
or
Dim pDocument As iManDocument
if it will take it.
shahbm
Thx for that. I've fixed this prb by declaring rpselecteddocuments and pdocuments as object and then converting the elements of rpselecteddocuments to Imandocument.
Now, the second problem I have, which is related to adding a custom field into the Edit Profile dialgue through dialogue editor..
I've created a lookup button (custom15) and a corresponding edit text field (custom15) in my edit profile dialogue through dialogue editor.
Now when I open edit profile dialogue and enter any text into my custom field and try to save it, it disables the save button and give me a red cross next to my custom field. It looks like it is validating that field!! I am not sure what I am missig here, can anyone pls help me out..
The image of the error is attached in my first post!!
Thx
B