| Back | Main view | Parent doc
IMiS Menu button
Let's take a look at the code under IMiS Menu button:
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim IMiSAttachArray List As String
Set IMiSCurrUIdoc = workspace.CurrentDocument
Set IMiSCurrDoc = IMiSCurrUIdoc.Document
EditAccess% = 0
IMiSLahkoPopravlja = False
EditAccess% = Cint(IMiSIsUserEditor(IMiSCurrDoc.ParentDatabase.Server, IMiSCurrDoc.ParentDatabase.FilePath, IMiSCurrDoc.NoteID))
If EditAccess% = 1 Then IMiSLahkoPopravlja = True
IMiSInitProfile("")
resultlng& = IMiSSelectMenuAction(IMiSCurrUIdoc, IMiSActionIndex%,IMiSObjectIndex%)
%REM
Function IMiSSelectMenuAction(SelectedUIDoc As NotesUIDocument, IMiSAction As Integer, IMiSObject As Integer) As Long
- SelectedUIDoc is the Notes front end document where we want to use one of IMiS Actions.
- IMiSActionIndex% is index of the action selected by user.
- IMiSObjectIndex% is index of the IMiS object selected by user.
Return Value:
0 - everything is OK. Select menu action process has finished with no errors.
-1 - Select menu action process has finished with errors. Most of the errors are reported to user.
%END REM
Select Case IMiSActionIndex%
Case 1 : 'Delete selected object from current document
Call IMiSDelete(IMiSCurrDoc, IMiSObjectIndex%)
%REM
Sub IMiSDelete(SelectedDoc As NotesDocument, IMiSObjectIndex As Integer)
%END REM
Call IMiSCurrUIdoc.Reload
Call IMiSCurrUIdoc.Refresh
Case 2 : 'Copy selected object from current document
Call IMiSCopy(IMiSCurrDoc, IMiSObjectIndex%)
%REM
Sub IMiSCopy(SelectedDoc As NotesDocument, IMiSObjectIndex As Integer)
%END REM
Case 3 : 'Paste object to current document
Call IMiSPaste(IMiSCurrDoc)
%REM
Sub IMiSPaste(SelectedDoc As NotesDocument)
%END REM
Call IMiSCurrUIdoc.Reload
Call IMiSCurrUIdoc.RefreshHideFormulas
Case 4 : 'Send selected object by e-mail
Call IMiSSend(IMiSCurrDoc, IMiSObjectIndex%)
%REM
Sub IMiSSend(SelectedDoc As NotesDocument, IMiSObjectIndex As Integer)
%END REM
Case 5 : 'OCR selected object in IMiS/OCR client. Client has to be installed on the machine.
Call IMiSOCR(IMiSCurrUIdoc, IMiSObjectIndex%, True, "")
%REM
Sub IMiSOCR(SelectedUIDoc As NotesUIDocument, IMiSObjectIndex As Integer, IMiSAttachOCR As Variant, IMiSAttachField As String)
- IMiSAttachOCR (True or False) - if current front end document is in edit mode, than we can select if OCR result is attached to document
- IMiSAttachField - name of Rich Text field, where OCR result will be attached to. If empty, then attachment is created at the end of the current document. If IMiSAttachOCR is False or document is in Read mode, then this parameter is ignored.
%END REM
Case 6 : 'Attach selected object from storage to Notes document
Call IMiSAttach(IMiSCurrUIdoc, IMiSObjectIndex%, "")
%REM
Sub IMiSAttach(SelectedUIDoc As NotesUIDocument, IMiSObjectIndex As Integer, IMiSAttachField As String)
- IMiSAttachField - name of Rich Text field, where OCR result will be attached to. If empty, then attachment is created at the end of the current document.
%END REM
Case 7 : 'send selected object to IMiS OCR server
Call IMiSOCRServer(IMiSCurrDoc, IMiSObjectIndex%)
%REM
Sub IMiSOCRServer(SelectedDoc As NotesDocument, IMiSObjectIndex As Integer)
%END REM
Case 8 : 'import file from File System to storage
resultint% = IMiSImport(IMiSCurrUIdoc, False, False, "")
%REM
Function IMiSImport(SelectedUIDoc As NotesuiDocument, ShowStorageSelectionDialog As Variant, ShowObjectDescriptionDialog As Variant, DefaultDescription As String) As Integer
- SelectedUIDoc is the Notes front end document where we want to create new IMiS object with import process.
- With ShowStorageSelectionDialog (True or False) we can select if user is presented with dialog for selecting storage server, where image will be saved. List of servers is built automaticlly from IMiS Administration database. If False, then user's storage server setting from IMiS Administration database is used.
- With ShowObjectDescriptionDialog (True or False) we can select if user is presented with dialog for object description.
- DefaultDescription presents default object description. This value will be used for object description automaticlly if ShowObjectDescriptionDialog is False. Otherwise user will get it in object description dialog and will be able to change it.
Return Value:
0 - everything is OK. Import process has finished with no errors.
-1 - import process has finished with errors.
%END REM
Call IMiSCurrUIdoc.Reload
Call IMiSCurrUIdoc.RefreshHideFormulas
Case 9 : 'Select and insert link from ODMA stored image to current Notes document
Call IMiSInsertODMADoc(IMiSCurrDoc)
%REM
Sub IMiSInsertODMADoc(SelectedDoc As NotesDocument)
%END REM
Call IMiSCurrUIdoc.Reload
Call IMiSCurrUIdoc.RefreshHideFormulas
Case 10 : 'OCR client for attachments
Call IMiSOCRAtt(IMiSCurrUIdoc, True, "")
%REM
Sub IMiSOCRAtt(SelectedUIDoc As NotesUIDocument, IMiSAttachOCR As Variant, IMiSAttachField As String)
- see description of parameters in IMiSOCR Sub
%END REM
Case 11 : 'Edit non IMiS objects
IMiSResultInt% = IMiSEditOther(IMiSCurrDoc, IMiSObjectIndex%)
%REM
Function IMiSEditOther((SelectedDoc As NotesDocument, IMiSObjectIndex As Integer) As Integer
Return Value:
0 - everything is OK. Edit process has finished with no errors.
-1 - edit process has finished with errors.
%END REM
Case 12 : 'Import attachment to IMiS/ARC server
IMiSResultInt% = IMiSImportAttachment(IMiSCurrDoc, IMiSAttachArray(IMiSObjectIndex%), False, True, "")
%REM
Function IMiSImportAttachment(SelectedDoc As NotesDocument, IMiSSelectedAttachment As String, ShowStorageSelectionDialog As Variant, ShowObjectDescriptionDialog As Variant, DefaultDescription As String) As Integer
- SelectedDoc is the Notes front end document where we want to create new IMiS object with import process.
- IMiSSelectedAttachment is the file name of selected attachment in otes document
- With ShowStorageSelectionDialog (True or False) we can select if user is presented with dialog for selecting storage server, where image will be saved. List of servers is built automaticlly from IMiS Administration database. If False, then user's storage server setting from IMiS Administration database is used.
- With ShowObjectDescriptionDialog (True or False) we can select if user is presented with dialog for object description.
- DefaultDescription presents default object description. This value will be used for object description automaticlly if ShowObjectDescriptionDialog is False. Otherwise user will get it in object description dialog and will be able to change it.
Return Value:
0 - everything is OK. Import process has finished with no errors.
-1 - import process has finished with errors.
%END REM
Case 13 : 'Print IMiS object
IMiSResultInt% = IMiSPrintObject (IMiSCurrDoc, IMiSObjectIndex%)
%REM
Function IMiSPrintObject (SelectedDoc As NotesDocument, IMiSObjectIndex As Integer) As Integer
Return Value:
0 - everything is OK. Print process has finished with no errors.
-1 - process has finished with errors.
%END REM
Case 14 : 'Export IMiS object
IMiSResultInt% = IMiSExportObject (IMiSCurrDoc, IMiSObjectIndex%)
%REM
Function IMiSPrintObject (SelectedDoc As NotesDocument, IMiSObjectIndex As Integer) As Integer
Return Value:
0 - everything is OK. Export process has finished with no errors.
-1 - process has finished with errors.
%END REM
Case 15 : 'Send All objects by email
Call IMiSSendAll(IMiSCurrDoc)
%REM
Sub IMiSSendAll(SelectedDoc As NotesDocument)
%END REM
Case 16 : 'Rename object description
Call IMiSChangeDescription(IMiSCurrDoc,IMiSObjectIndex%)
%REM
Sub IMiSChangeDescription (SelectedDoc As NotesDocument, IMiSObjectIndex As Integer)
%END REM
Call IMiSCurrUIdoc.Reload
Call IMiSCurrUIdoc.RefreshHideFormulas
Case 17 : 'send selected object to IMiS OCR server for PDF convert
Call IMiSPDFServer(IMiSCurrDoc, IMiSObjectIndex%)
%REM
Sub IMiSPDFServer(SelectedDoc As NotesDocument, IMiSObjectIndex As Integer)
%END REM
Case 18 : 'export all objects to selected folder
resultint% = IMiSExportAll(IMiSCurrDoc)
%REM
Function IMiSExportAll (SelectedDoc As NotesDocument) As Integer
Return Value:
0 - everything is OK. Export Object process has finished with no errors.
-1 - process has finished with errors.
%END REM
Case 19 : 'import all attachments to storage server
resultint% = IMiSImportAllAttachments(IMiSCurrUIDoc, False, False)
%REM
Function IMiSImportAllAttachments(SelectedUIDoc As NotesUIDocument, ShowStorageSelectionDialog As Variant, ShowObjectDescriptionDialog As Variant) As Integer
Return Value:
0 - everything is OK. Import attachments process has finished with no errors.
-1 - process has finished with errors.
%END REM
End Select
End Sub
As we can see, we have some new and usefull features even inside parameters of functions and subs that represent action in IMiS Menu button. And of course, as already mentioned, developer is able to put some LotusScript code right before or after any process - for example:
- developer can restrict user to begin process based on some values in current Notes document
- or can check user roles and provide own enhanced security features
- etc.
| Back | Main view | Parent doc