header
Menu Principale
Home
Novità
Novità ICT
Blog
Links
In un'altra vita...
... in questa vita
Sto studiando...
Contattami
Ricerca
Il libro degli ospiti
News Feeds
Downloads
La Licenza di Joomla!
Tutti i link
Fastnet: la mia azienda
Sponsored Links
Modulo di Accesso





Password dimenticata?
Nessun account? Registrati

Album più recente

EMBA-ICT Finance: Cena 10 luglio 2008 EMBA-ICT Finance: Cena 10 luglio 2008
Syndicate
Rss Ict
Punto Informatico
Il quotidiano di Internet dal 1996
Linux Today
Linux Today News Service
 
Home
header
Aggiornare dinamicamente campi rich-text con LotusScript
Valutazione utente: / 0
Scritto da Filippo Del Prete   
martedì 19 agosto 2008

Fastnet Spa Di seguito la traduzione di un articolo che illustra come gestire tramite LotusScript gli allegati in un campo rich-text sul documento Lotus Notes aperto sul front-end.

 Lotus

Aggiornare dinamicamente campi rich-text con LotusScript

Titolo originale: "Dynamically update Lotus Notes rich-text fields using LotusScript"


Autore: Amith Narera
11.20.2007

Una modifica effettuata su un documento Lotus Notes nel back-end viene solitamente riprodotta nel documento di front-end, ma u'eccezione a questo comportamento sono i campi di tipo rich-text. Per le modifiche ai campi rich-text, si deve chiudere il doumento Lotus Notes di front-end e aprirlo di nuovo usando il metodo NotesUIWorkspace.EditDocument. Comunque, questo fa "scatenare" tutti gli eventi associati alla form Lotus Notes. Questo tip aggira questo problema consentendo di aggiornare dinamicamente i campi rich-text del front-end senza chiudere e riaprire la form Lotus Notes principale.

A scopo esemplificativo, aggiungo l'attuale username Lotus Notes, l'ora di sistema e gli allegati (selezionati dall'utente Lotus Notes) al campo rich-text. Il seguente codice LotusScript consente anche di appendere item rich-text da un altro documento Lotus Notes (codice commentato).

Quello che segue è uno schema di come il codice LotusScript lavora:

  • Crea un documento Lotus Notes "di appoggio" nel back end usando il metodo db.CreateDocument.
  • Aggiunge un campo rich-text al documento.
  • Esegue tutte le azioni necessarie su questo campo rich-text .
  • Apre il documento Lotus Notes nel front-end coun una form "di appoggio" che contine solamente un campo rich-text (con lo stesso nome di quello creato nel secondo passaggio visto prima).
  • posiziona il cursore in questo campo rich-text, seleziona tutto il testo, e copia tutto negli appunti.
  • Chiude la form Lotus Notes "di appoggio".
  • Va sul campo rich-text di destinazine sulla form Lotus Notes principale.
  • Incolla tutto dagli appunti.
  • Missione eseguita.

Questi sono gli step necessari per ottenere il risultato desiderato:

  1. Create a new form. Name it "Dummy Form."
  2. Place a rich-text field, named "DummyRT" on it.
  3. Open your main Lotus Notes form where you'd like these updates to happen.
  4. Create a new Action button, and name it "Update RT Field." You may use the LotusScript code anywhere. For the sake of simplicity I am using it in a button.
  5. Select LotusScript as the coding language and paste the code given below into it.
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession

'COMMENT #######> UiDoc represents the currently open Fron End document, where the rich text field exists.
Dim uidoc As NotesUIDocument

'COMMENT #######> Dummy UIDoc ---needed by the code
Dim DummyUIDoc As NotesUIDocument
Dim db As NotesDatabase

'COMMENT #######> Back End version of DummyUIDoc
Dim DummyDoc As NotesDocument

'COMMENT #######> RT Item in DummyDoc ---From where you would be pulling the changes
Dim DummyRT As NotesRichTextItem
Dim FilePath As Variant

Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument

Set DummyDoc = db.CreateDocument

'COMMENT #######> Set Fields for Dummy Document
DummyDoc.Form = "Dummy Form" ' NOTE: It shud be dummy form, not your main form.
DummyDoc.SaveOptions = "0"

'COMMENT #######> Get the File path for the file to be attached
FilePath = workspace.OpenFileDialog(True, "Select Files")

'COMMENT #######> Insert RT Field
Set DummyRT = New NotesRichTextItem(DummyDoc,"DummyRT")

'COMMENT #######> Update the Field- as per your requirements
Call DummyRT.AppendText(session.CommonUserName & " - ")
Call DummyRT.AppendText(Cstr(Now))
Call DummyRT.AddNewline(1)

'COMMENT #######>Embed Selected Files, if Any
If Not Isempty(FilePath) Then
Forall CurrentFilepath In FilePath
Call DummyRT.EmbedObject(1454,"", CurrentFilePath)
End Forall
End If
'COMMENT #######>You may also append an RT Item from any other document. eg.
%REM
Dim RTItemB As NotesRichTextItem
Set RTItemB = DocB.GetFirstItem("RTItemName")
Call DummyRT.AppendRTItem(RTItemB)
%END REM

'COMMENT #######> Call this to commit all the RT Item Changes to the Document
Call DummyRT.Update

'Here is the Trick
'*******************************************************************************************
Set DummyUIDoc = workspace.EditDocument(True,DummyDoc)
Call DummyUIDoc.GotoField("DummyRT")
Call DummyUIDoc.SelectAll
Call DummyUIDoc.Copy
Call DummyUIDoc.Close(True)
'COMMENT #######> Goto Main doc Rich Text Field (desitnation field)
Call uidoc.GotoField("RTF")
Call uidoc.Paste

'*******************************************************************************************
Messagebox "Process Completed Successfully.", 64, "Complete"
End Sub

Now -- with a click of this action button -- you can update the front end of your rich-text item in real-time without having to close and re-open the main Lotus Notes document. You can also apply the same logic to move contents of one rich-text item to the other rich-text item on the same form in real time -- without having to re-open the front end document. If you'd like to do that, this code will help you:

Call UIDoc.GotoField("FirstRT")
Call UIDoc.SelectAll
Call UIDoc.Copy
Call uidoc.GotoField("SecondRT")
Call uidoc.Paste

Lascia il primo commento! | Riporta quest'articolo sul tuo sito! | Visualizzazioni: 23

 
Domino Configuration Tuner - First Look
Valutazione utente: / 0
Scritto da Filippo Del Prete   
domenica 13 luglio 2008


Ho installato l'ultima beta di IBM Lotus Notes 8.5 con l'obiettivo di dare un'occhiata ad un tool presente nella stessa distribuzione.

Lo strumento in questione è un'applicazione Lotus Notes denominata Domino Configuration Tuner: consente (a partire dai server in versione 7.0) di analizzare la configurazione di uno o più server per rilevare eventuali problemi di configurazione e suggerire i necessari aggiustamenti.

Quindi ho creato un nuvo db a partire dal template esistente (lo trovate in locale attivando l'opzione "show advanced templates") e l'ho denominato dct.nsf

 

Fig. 1 - Domino Configuration Tuner - Welcome Page

Ho aperto poi il db appena creato (vedi figura 1) e ho fatto click sul pulsante "Run new scan".

La prima volta mi è stato chiesto di inizializzare la lista dei server presenti.

Ho quindi selezionato uno dei server della lista e ho fatto click sul pulsante Scan.

Fig. 2 - La selezione del server da controllare
 

Dopo pochi minuti è apparso un interessante report che mostrava suddivisi per Severity i problemi riscontrati con il server analizzato.

Fig. 3 - Il report ottenuto

Selezionando sulla sinistra una delle voci del report sulla destra dello schermo compaino alcune utili informazioni suddivise in:

  • Explanation (viene fornita una dettagliata spiegazione della voce selezionata)
  • Reccomandations (vengono raccomandate le eventuali modifiche)
  • Databases (contiene l'elenco dei database su cui l'impostazione ha un impatto)
  • Links & References (risorse addizonali)

Fig. 4 - Il dettaglio di un problema riscontrato

Facendo click sul pulsante in lato a destra Help appare la schermata di figura 5 che contiene interessanti informazioni.

Fig. 5 - La schermata di Help
 

Mi sembra che si tratti di un ottimo strumento a cui un Domino Administrator difficilemente potrà rinunciare.

Lascia il primo commento! | Riporta quest'articolo sul tuo sito! | Visualizzazioni: 163

 
Il mio curriculum con Wordle
Valutazione utente: / 0
Scritto da Filippo Del Prete   
mercoledì 02 luglio 2008

 

Wordle is a toy for generating “word clouds” from text that you provide. The clouds give greater prominence to words that appear more frequently in the source text. You can tweak your clouds with different fonts, layouts, and color schemes. The images you create with Wordle are yours to use however you like. You can print them out, or save them to the Wordle gallery to share with your friends.

Qui sotto il mio curriculum versione Wordle

Lascia il primo commento! | Riporta quest'articolo sul tuo sito! | Visualizzazioni: 142

 
Altri articoli...
<< Inizio < Prec. 1 2 3 4 5 6 7 8 9 10 Pross. > Fine >>

Risultati 1 - 4 di 58

 
 
Tags Cloud

server domino gruppo internet sistema database gestione installazione software imprese client versione azienda soluzione business cliente proposition manager master bambini

Powered by RafCloud 2.0.2
Che tempo fa
Ancona/Falconara, Italy
temperatura: 20°C
Freddo del vento: 20°C
Umidità: 88%
Velocità del Vento: 2 km/h
direzione:
Barometro: 1012.9 mb
VAR
mostra più particolari
fornito da: 
View Filippo Maria Del Prete's profile on LinkedIn
Ultimissime
Una foto...
Sherpa Walk_7a Sherpa Walk_7a
Le più lette
Chi è Online
Re-Designed By Me original design By MeMoodleThemes